summaryrefslogtreecommitdiffstats
path: root/Lib/_pyio.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r--Lib/_pyio.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index 4c24146..8eaa114 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -792,6 +792,9 @@ class _BufferedIOMixin(BufferedIOBase):
return pos
def truncate(self, pos=None):
+ self._checkClosed()
+ self._checkWritable()
+
# Flush the stream. We're mixing buffered I/O with lower-level I/O,
# and a flush may be necessary to synch both views of the current
# file state.