[Python-Dev] Another StringIO/cStringIO discrepancy

Walter Dörwald walter at livinglogic.de
Fri Nov 18 14:26:09 CET 2005


 >>> import StringIO, cStringIO
 >>> s = StringIO.StringIO()
 >>> s.truncate(-42)
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/local/lib/python2.4/StringIO.py", line 203, in truncate
     raise IOError(EINVAL, "Negative size not allowed")
IOError: [Errno 22] Negative size not allowed
 >>> s = cStringIO.StringIO()
 >>> s.truncate(-42)
 >>>


More information about the Python-Dev mailing list