[Numpy-discussion] StringIO test failure with Python3.1.2

Bruce Southey bsouthey at gmail.com
Wed Mar 24 11:59:20 EDT 2010


On 03/24/2010 10:30 AM, Pauli Virtanen wrote:
> ke, 2010-03-24 kello 10:28 -0500, Robert Kern kirjoitti:
>    
>> utils.py is the only file in there that imports StringIO. It should
>> probably do a local import "from io import BytesIO" because io.py
>> already contains some Python3-awareness:
>>
>> if sys.version_info[0]>= 3:
>>      import io
>>      BytesIO = io.BytesIO
>> else:
>>      from cStringIO import StringIO as BytesIO
>>      
> The lookfor stuff in utils.py deals with docstrings, so it probably has
> to use StringIO instead of BytesIO for unicode-cleanliness.
>
> 	Pauli
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>    

This appears to be a regression because I do not get the error with 
Python 3.1.1.
I rebuilt Python3.1.1 and Python3.1.2 to compare the builds (I don't 
know how to keep the two Python 3.1 minor releases separate). From the 
diff it is clear that Python3.1.2 (build directory) is adding the .io 
but the Python3.1.1 (build311 directory).

$ diff build/py3k/numpy/lib/utils.py build311/py3k/numpy/lib/utils.py
8d7
< import collections
852c851
<     from .io import StringIO
---
 >     from io import StringIO
945c944
<         elif isinstance(item, collections.Callable):
---
 >         elif hasattr(item, '__call__'):

Bruce




More information about the NumPy-Discussion mailing list