[IPython-dev] IPython 0.10.1 -pylab

Fernando Perez fperez.net@gmail....
Sun Oct 10 15:32:25 CDT 2010


Hi Eric,

On Sun, Oct 10, 2010 at 11:56 AM, Eric Firing <efiring@hawaii.edu> wrote:
> This sounds dimly familiar--could the fact that mpl imports locale (in
> cbook.py) be causing this?  A quick google did not turn anything up, but
> I think there was something like this reported earlier, where importing
> pylab was subtly changing the environment.

thanks for the tip, that does sound like it could point in the right
direction...

If the OP is willing to test it out, this might clarify things.  I had
a look in matplotlib, and it's easy: comment out the locale import and
change the code below in matplotlib's cbook.py:

try:
    preferredencoding = locale.getpreferredencoding().strip()
    if not preferredencoding:
        preferredencoding = None
except (ValueError, ImportError, AttributeError):
    preferredencoding = None

to:

try:
    preferredencoding = locale.getpreferredencoding().strip()
    if not preferredencoding:
        preferredencoding = None
except (ValueError, ImportError, AttributeError, NameError):
    preferredencoding = None


The change is just adding NameError to the list of exceptions.

If this makes the problem go away, we'll at least know what the origin
of the issue is, and we can think about a solution.

Regards,

f


More information about the IPython-dev mailing list