Message7955
Unfortunately not (I tried :) - apparently StringIO.StringIO and cStringIO.StringIO have very different behaviors in CPython:
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cStringIO
>>> import StringIO
>>> import array
>>> a = array.array('B', [0,1,2])
>>> c = cStringIO(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>> c = cStringIO.StringIO(a)
>>> s = StringIO.StringIO(a)
>>> c.getvalue()
'\x00\x01\x02'
>>> s.getvalue()
"array('B', [0, 1, 2])"
Your patch will make our cStringIO act like StringIO. Seems like a CPython bug to me that they behave differently. Maybe they think so too since it looks like StringIO was dropped in Python3. |
|
Date |
User |
Action |
Args |
2013-03-22 16:17:12 | fwierzbicki | set | messageid: <1363969032.41.0.00993402127853.issue1862@psf.upfronthosting.co.za> |
2013-03-22 16:17:12 | fwierzbicki | set | recipients:
+ fwierzbicki, amak, santa4nt |
2013-03-22 16:17:12 | fwierzbicki | link | issue1862 messages |
2013-03-22 16:17:12 | fwierzbicki | create | |
|