Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pelson merged 17 commits intomatplotlib:masterfrommgiuca-google:no-home-dir
Apr 16, 2013
Merged
Changes from1 commit
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
8083f25
shutil.move: Guard against IOError and print warnings instead of cras…
mgiuca-googleMar 6, 2013
a697a26
matplotlib: _is_writable_dir uses os.access instead of TemporaryFile.
mgiuca-googleMar 6, 2013
4d65400
Matplotlib now works when the user has no home directory.
mgiuca-googleMar 6, 2013
21921a3
get_configdir returns None if tempfile.gettempdir() is not available.
mgiuca-googleMar 6, 2013
4987dcd
Deal with all cases where get_configdir might return None.
mgiuca-googleMar 6, 2013
64c797b
font_manager: Gracefully handle the case of there being no config dir.
mgiuca-googleMar 6, 2013
1dbd6de
texmanager: Gracefully handle the case of there being no config dir u…
mgiuca-googleMar 6, 2013
1adfc85
finance: Gracefully handle the case of there being no config dir.
mgiuca-googleMar 8, 2013
941efd4
Fix formatting and other misc code tweaks.
mgiuca-googleMar 17, 2013
ca6cd19
matplotlib.get_home: Removing catch-all except blocks.
mgiuca-googleMar 18, 2013
cc8cd1b
matplotlib, texmanager: Change WARNING prints into real warnings.
mgiuca-googleMar 18, 2013
f01ebe1
matplotlib, texmanager: Only print the rename message if it actually …
mgiuca-googleMar 18, 2013
018ce26
finance: Fixed caching when cachename is supplied.
mgiuca-googleMar 18, 2013
6a4f1e7
matplotlib: Use cbook.mkdirs instead of os.makedirs.
mgiuca-googleMar 18, 2013
4f55a27
matplotlib: Remove catch for OSError.
mgiuca-googleMar 18, 2013
81639a1
matplotlib: _is_writable_dir checks that it is a directory.
mgiuca-googleMar 18, 2013
8335773
matplotlib: _is_writable_dir tests with os.access and TemporaryFile.
mgiuca-googleMar 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
PrevPrevious commit
NextNext commit
get_configdir returns None if tempfile.gettempdir() is not available.
Previously, it would raise NotImplementedError. This is necessary on restrictedplatforms such as Google App Engine that do not provide gettempdir.
  • Loading branch information
@mgiuca-google
mgiuca-google committedApr 16, 2013
commit21921a3e77b07b666bd35bd365853d3c6d4fe9da
15 changes: 12 additions & 3 deletionslib/matplotlib/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -495,12 +495,19 @@ def _create_tmp_config_dir():
"""
If the config directory can not be created, create a temporary
directory.

Returns None if a writable temporary directory could not be created.
"""
import getpass
import tempfile

tempdir = os.path.join(
tempfile.gettempdir(), 'matplotlib-%s' % getpass.getuser())
try:
tempdir = tempfile.gettempdir()
except NotImplementedError:
# Some restricted platforms (such as Google App Engine) do not provide
# gettempdir.
return None
tempdir = os.path.join(tempdir, 'matplotlib-%s' % getpass.getuser())
os.environ['MPLCONFIGDIR'] = tempdir

return tempdir
Expand All@@ -519,7 +526,9 @@ def _get_configdir():
create it if necessary).
2. If the chosen directory exists and is writable, use that as the
configuration directory.
3. Create a temporary directory, and use it as the configuration directory.
3. If possible, create a temporary directory, and use it as the
configuration directory.
4. A writable directory could not be found or created; return None.
"""

configdir = os.environ.get('MPLCONFIGDIR')
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp