Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

BUG: weave: don't fail in default_dir() on $HOME not being writable. #402

Merged
merged 1 commit into from

1 participant

@rgommers
Owner

Thanks to jdemeyer. Closes #1821.

@rgommers
Owner

This patch seems straightforward, will merge it unless someone comments within a day or two.

@rgommers rgommers merged commit ca06d46 into scipy:master
@rgommers rgommers deleted the rgommers:ticket-1821-weave branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 23, 2013
  1. @rgommers
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 scipy/weave/catalog.py
View
9 scipy/weave/catalog.py
@@ -141,6 +141,8 @@ def is_writable(dir):
res : bool
True or False.
"""
+ if not os.path.isdir(dir):
+ return False
# Do NOT use a hardcoded name here due to the danger from race conditions
# on NFS when multiple processes are accessing the same base directory in
@@ -203,8 +205,11 @@ def default_dir():
writable = False
for path in path_candidates:
if not os.path.exists(path):
- create_dir(path)
- os.chmod(path, 0700) # make it only accessible by this user.
+ try:
+ create_dir(path)
+ os.chmod(path, 0700) # make it only accessible by this user.
+ except OSError:
+ continue
if is_writable(path):
writable = True
break
Something went wrong with that request. Please try again.