[issue30250] StreamIO truncate behavior of current position

Josh Rosenberg report at bugs.python.org
Wed May 3 15:02:47 EDT 2017


Josh Rosenberg added the comment:

For the record, the StringIO module is Python 2 only (replaced by io.StringIO and io.BytesIO for Py3, which are also available on 2.6 and higher if you need consistency), and only documents truncate by reference to the generic docs for the built-in file object. Admittedly, the built-in file object docs say the position shouldn't change on truncate, but given:

1. StringIO is deprecated and no longer maintained
2. Code using it may rely on this incorrect behavior

I can't see fixing this beyond possibly mentioning the quirk in the 2.x StringIO docs. Since io.StringIO is correct, there is nothing to fix in 3.x.

----------
nosy: +josh.r

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30250>
_______________________________________


More information about the Python-bugs-list mailing list