|
From: Martin M. <mmo...@fo...> - 2012-06-18 11:19:40
|
Hi,
I am running some script in /mnt/blah and while my $HOME disk on a different device filled up
because of some other reason. But my script ran in /mnt/blah died as well while there is plenty
of space. Here is the stacktrace.
import matplotlib
File "/usr/lib64/python2.7/site-packages/matplotlib/__init__.py", line 765, in <module>
rcParams = rc_params()
File "/usr/lib64/python2.7/site-packages/matplotlib/__init__.py", line 683, in rc_params
fname = matplotlib_fname()
File "/usr/lib64/python2.7/site-packages/matplotlib/__init__.py", line 595, in matplotlib_fname
fname = os.path.join(get_configdir(), 'matplotlibrc')
File "/usr/lib64/python2.7/site-packages/matplotlib/__init__.py", line 246, in wrapper
ret = func(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/matplotlib/__init__.py", line 467, in _get_configdir
if not _is_writable_dir(p):
File "/usr/lib64/python2.7/site-packages/matplotlib/__init__.py", line 176, in _is_writable_dir
t.close()
IOError: [Errno 28] No space left on device
Is this kind of check necessary at all? This is matplotlib-1.1.0 on Linux.
Thank you,
Martin
|
|
From: John H. <jd...@gm...> - 2012-06-18 11:37:06
|
On Jun 18, 2012, at 6:19 AM, Martin Mokrejs <mmo...@fo...> wrote: > Hi, > I am running some script in /mnt/blah and while my $HOME disk on a different device filled up > because of some other reason. But my script ran in /mnt/blah died as well while there is plenty > of space. Here is the stacktrace. Try setting the MPLCONFIGDIR environment variable to the writable dir or your choice. mpl does need a place to store some files, which is $HOME/.matplotlib by default, but you can configure it. > |
|
From: Martin M. <mmo...@fo...> - 2012-06-18 12:29:40
|
John Hunter wrote: > > > > > On Jun 18, 2012, at 6:19 AM, Martin Mokrejs <mmo...@fo...> wrote: > >> Hi, >> I am running some script in /mnt/blah and while my $HOME disk on a different device filled up >> because of some other reason. But my script ran in /mnt/blah died as well while there is plenty >> of space. Here is the stacktrace. > > Try setting the MPLCONFIGDIR environment variable to the writable dir or your choice. > > mpl does need a place to store some files, which is $HOME/.matplotlib by default, but you can configure it. Hmm. Could it be by default the current working directory instead? Or, try/else added to the code which would try to write into cwd if $HOME (aka $MPLCONFIGDIR) returns an error? I will set the variable in my scripts but too late for those already in the queue. ;-) Thanks. Martin |
|
From: John H. <jd...@gm...> - 2012-06-18 12:42:00
|
On Mon, Jun 18, 2012 at 7:29 AM, Martin Mokrejs <mmo...@fo...> wrote: > Hmm. Could it be by default the current working directory instead? Or, try/else added to the code > which would try to write into cwd if $HOME (aka $MPLCONFIGDIR) returns an error? The stuff we store there is meant to be persistent between runs, primarily a cache of all the fonts we find on your system. So defaulting to the current working directory is not a good idea because then we would have configs littered across the filesystem and would not be able to take advantage of the information gleaned from previous runs from other directories. JDH |
|
From: Benjamin R. <ben...@ou...> - 2012-06-18 12:51:09
|
On Mon, Jun 18, 2012 at 8:41 AM, John Hunter <jd...@gm...> wrote: > On Mon, Jun 18, 2012 at 7:29 AM, Martin Mokrejs > <mmo...@fo...> wrote: > > > Hmm. Could it be by default the current working directory instead? Or, > try/else added to the code > > which would try to write into cwd if $HOME (aka $MPLCONFIGDIR) returns > an error? > > The stuff we store there is meant to be persistent between runs, > primarily a cache of all the fonts we find on your system. So > defaulting to the current working directory is not a good idea because > then we would have configs littered across the filesystem and would > not be able to take advantage of the information gleaned from previous > runs from other directories. > > JDH > > However, should it be a full-out error? Is it possible to have mpl run without a font cache? Just a thought. Ben Root |
|
From: John H. <jd...@gm...> - 2012-06-18 12:54:33
|
On Mon, Jun 18, 2012 at 7:50 AM, Benjamin Root <ben...@ou...> wrote: > However, should it be a full-out error? Is it possible to have mpl run > without a font cache? I'm sure we could, but from an implementation perspective it would probably be easier to spoof it with a virtual filesystem and files using string io or equivalent. I think this would be a good feature if anyone wants to pursue it. JDH |