8000 Support environments without a home dir or writable file system by mgiuca-google · Pull Request #1824 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Support environments without a home dir or writable file system #1824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Apr 16, 2013
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8083f25
shutil.move: Guard against IOError and print warnings instead of cras…
mgiuca-google Mar 6, 2013
a697a26
matplotlib: _is_writable_dir uses os.access instead of TemporaryFile.
mgiuca-google Mar 6, 2013
4d65400
Matplotlib now works when the user has no home directory.
mgiuca-google Mar 6, 2013
21921a3
get_configdir returns None if tempfile.gettempdir() is not available.
mgiuca-google Mar 6, 2013
4987dcd
Deal with all cases where get_configdir might return None.
mgiuca-google Mar 6, 2013
64c797b
font_manager: Gracefully handle the case of there being no config dir.
mgiuca-google Mar 6, 2013
1dbd6de
texmanager: Gracefully handle the case of there being no config dir u…
mgiuca-google Mar 6, 2013
1adfc85
finance: Gracefully handle the case of there being no config dir.
mgiuca-google Mar 8, 2013
941efd4
Fix formatting and other misc code tweaks.
mgiuca-google Mar 17, 2013
ca6cd19
matplotlib.get_home: Removing catch-all except blocks.
mgiuca-google Mar 18, 2013
cc8cd1b
matplotlib, texmanager: Change WARNING prints into real warnings.
mgiuca-google Mar 18, 2013
f01ebe1
matplotlib, texmanager: Only print the rename message if it actually …
mgiuca-google Mar 18, 2013
018ce26
finance: Fixed caching when cachename is supplied.
mgiuca-google Mar 18, 2013
6a4f1e7
matplotlib: Use cbook.mkdirs instead of os.makedirs.
mgiuca-google Mar 18, 2013
4f55a27
matplotlib: Remove catch for OSError.
mgiuca-google Mar 18, 2013
81639a1
matplotlib: _is_writable_dir checks that it is a directory.
mgiuca-google Mar 18, 2013
8335773
matplotlib: _is_writable_dir tests with os.access and TemporaryFile.
mgiuca-google Mar 18, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
matplotlib.get_home: Removing catch-all except blocks.
  • Loading branch information
mgiuca-google committed Apr 16, 2013
commit ca6cd190995b0ca744b9163a66a715011d06146d
12 changes: 5 additions & 7 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,18 +479,16 @@ def _get_home():
"""
try:
path = os.path.expanduser("~")
except:
except ImportError:
# This happens on Google App Engine (pwd module is not present).
pass
else:
if os.path.isdir(path):
return path
for evar in ('HOME', 'USERPROFILE', 'TMP'):
try:
path = os.environ[evar]
if os.path.isdir(path):
return path
except:
pass
path = os.environ.get(evar)
if path is not None and os.path.isdir(path):
return path
return None


Expand Down
0