f.seek(10)
f.truncate()
eq(f.getvalue(), 'abcdefghij')
- f.seek(0)
f.truncate(5)
eq(f.getvalue(), 'abcde')
+ f.write('xyz')
+ eq(f.getvalue(), 'abcdexyz')
f.close()
self.assertRaises(ValueError, f.write, 'frobnitz')
Extension modules
-----------------
+- Patch 1012740: truncate() on a writeable cStringIO now resets the
+ position to the end of the stream. This is consistent with the original
+ StringIO module and avoids inadvertently resurrecting data that was
+ supposed to have been truncated away.
+
- Added socket.socketpair().
Library
- A new function tkFont.nametofont was added to return an existing
font. The Font class constructor now has an additional exists argument
which, if True, requests to return/configure an existing font, rather
- than creating a new one.
+ than creating a new one.
- Updated the decimal package's min() and max() methods to match the
latest revision of the General Decimal Arithmetic Specification.