Message7955

Author fwierzbicki
Recipients amak, fwierzbicki, santa4nt
Date 2013-03-22.16:17:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1363969032.41.0.00993402127853.issue1862@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-03-22 16:17:12fwierzbickisetmessageid: <1363969032.41.0.00993402127853.issue1862@psf.upfronthosting.co.za>
2013-03-22 16:17:12fwierzbickisetrecipients: + fwierzbicki, amak, santa4nt
2013-03-22 16:17:12fwierzbickilinkissue1862 messages
2013-03-22 16:17:12fwierzbickicreate