diff options
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r-- | Lib/_pyio.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 387c585..fa77ec1 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -895,12 +895,18 @@ class BytesIO(BufferedIOBase): return pos def readable(self): + if self.closed: + raise ValueError("I/O operation on closed file.") return True def writable(self): + if self.closed: + raise ValueError("I/O operation on closed file.") return True def seekable(self): + if self.closed: + raise ValueError("I/O operation on closed file.") return True @@ -1562,6 +1568,8 @@ class TextIOWrapper(TextIOBase): return self._buffer def seekable(self): + if self.closed: + raise ValueError("I/O operation on closed file.") return self._seekable def readable(self): |