We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86d13f4 commit c01a14cCopy full SHA for c01a14c
graalpython/com.oracle.graal.python.test/src/tests/test_io.py
@@ -262,6 +262,21 @@ def write(self, x):
262
def test_writelines_err(self):
263
self.assertRaises(AttributeError, _io._IOBase().writelines, ['aaa', 'bbb'])
264
265
+ def test_bytesio_unsharing(self):
266
+ f = _io.BytesIO()
267
+ f.write(b"1234")
268
+ first_pickled = f.getvalue()
269
+ f.seek(0)
270
+ f.truncate()
271
272
+ second_pickled = f.getvalue()
273
274
275
+ f.write(b"abcd")
276
+ third_pickled = f.getvalue()
277
+ self.assertEqual(first_pickled, b'1234')
278
+ self.assertEqual(second_pickled, b'1234')
279
+ self.assertEqual(third_pickled, b'abcd')
280
281
if __name__ == '__main__':
282
unittest.main()
0 commit comments