[Python-3000] StringIO/BytesIO in io.py doesn't over-seek properly

Alexandre Vassalotti alexandre at peadrop.com
Mon Jul 2 19:46:28 CEST 2007


If StringIO is not allowed to over-seek, what should happen to the
current file position when it is truncated?

   >>> s = StringIO("Hello world!")
   >>> s.seek(0, 2)
   >>> s.truncate(2)
   >>> s.tell()
   ???

Truncating can either set the position to the new string size, or it
leaves it alone.

-- Alexandre


More information about the Python-3000 mailing list