mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #15841: The readable(), writable() and seekable() methods of BytesIO
and StringIO objects now raise ValueError when the object has been closed. Patch by Alessandro Moura.
This commit is contained in:
parent
397e5c98bc
commit
1d857453b7
6 changed files with 47 additions and 12 deletions
|
@ -318,9 +318,9 @@ class MemoryTestMixin:
|
|||
self.assertEqual(memio.isatty(), False)
|
||||
self.assertEqual(memio.closed, False)
|
||||
memio.close()
|
||||
self.assertEqual(memio.writable(), True)
|
||||
self.assertEqual(memio.readable(), True)
|
||||
self.assertEqual(memio.seekable(), True)
|
||||
self.assertRaises(ValueError, memio.writable)
|
||||
self.assertRaises(ValueError, memio.readable)
|
||||
self.assertRaises(ValueError, memio.seekable)
|
||||
self.assertRaises(ValueError, memio.isatty)
|
||||
self.assertEqual(memio.closed, True)
|
||||
|
||||
|
@ -665,7 +665,6 @@ class CBytesIOTest(PyBytesIOTest):
|
|||
check(io.BytesIO(b'a'), basesize + 1 + 1 )
|
||||
check(io.BytesIO(b'a' * 1000), basesize + 1000 + 1 )
|
||||
|
||||
|
||||
class CStringIOTest(PyStringIOTest):
|
||||
ioclass = io.StringIO
|
||||
UnsupportedOperation = io.UnsupportedOperation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue