Eric Firing wrote:
> Tony S Yu wrote:
>> On Mar 9, 2010, at 1:22 PM, John Hunter wrote:
>>
>>> On Tue, Mar 9, 2010 at 12:16 PM, Eric Firing <efir...@hawaii.edu> wrote:
>>>
>>>> Bizarre!  I can reproduce it with python 2.6 (ubuntu 9.10) and mpl from
>>>> svn.  I have done a little grepping and other exploration, but have
>>>> completely failed to find where this change is occurring.
>>>
>>> cbook imports locale -- may be implicated:
>>>
>>> string.letters¶
>>>    The concatenation of the strings lowercase and uppercase described
>>> below. The specific value is locale-dependent, and will be updated
>>> when locale.setlocale() is called.
>>>
>>> See if simply importing locale first has the same effect.
>>
>> It seems to be an interaction between numpy and locale. I can reproduce the 
>> problem with:
>>
>>>>> import locale
>>>>> import numpy as np
>>>>> preferredencoding = locale.getpreferredencoding()
> 
> cbook also calls locale.getpreferredencoding() when it is imported.

Confirmation:

In [1]:import string

In [2]:string.letters
Out[2]:'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

In [3]:import locale

In [4]:locale.getpreferredencoding ()
Out[4]:'UTF-8'

In [5]:string.letters
Out[5]:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'

The lesson seems to be that the only proper use for string.letters is 
for testing membership, in which case the order does not matter.

Eric

> Eric
> 
> 
>>>>> import string
>>>>> print string.letters
>> The bug disappears after removing the numpy import.
>>
>> -Tony
>>
> 
> 
> 
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to