Skip to content
3 changes: 1 addition & 2 deletions Lib/_pyio.py
Original file line number Diff line number Diff line change
Expand Up @@ -2471,8 +2471,7 @@ def _reset_encoder(position):
else:
encoder.reset()

if self.closed:
raise ValueError("tell on closed file")
self._checkClosed()
if not self._seekable:
raise UnsupportedOperation("underlying stream is not seekable")
if whence == SEEK_CUR:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix the :exc:`ValueError` message when calling :meth:`~io.TextIOWrapper.seek`
on a closed :class:`!_pyio.TextIOWrapper`.
Loading