[issue30250] StreamIO truncate behavior of current position

2017-05-03 Thread Josh Rosenberg
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

[issue30250] StreamIO truncate behavior of current position

2017-05-03 Thread Albert Zeyer
New submission from Albert Zeyer: The doc says that StringIO.truncate should not change the current position. Consider this code: try: import StringIO except ImportError: import io as StringIO buf = StringIO.StringIO() assert_equal(buf.getvalue(), "") print("buf: %r" %