You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on typeshed stubs, I've noticed that _pyio.BufferedReader.read1 does not raise ValueError after .close. While _io.BufferedReader.read1 does that.
While working on typeshed stubs, I've noticed that
_pyio.BufferedReader.read1
does not raiseValueError
after.close
. While_io.BufferedReader.read1
does that.So, I went to see both implementation and tests.
C
source clearly checks for this here:cpython/Modules/_io/bufferedio.c
Line 910 in 0689b99
But, tests were not executed correctly. Tests were only covering
C
version: https://github.com/python/cpython/blame/0689b99bb8c4f6058af43a52effaa8a25609dbed/Lib/test/test_io.py#L1532-L1538While universal test would look like this:
And now it is failing:
After that, I've tested other methods and here's a list of methods that work on closed in
_pyio
, but raises on_io
:Related https://bugs.python.org/issue23796
Is it a bug or a feature? Is it worth fixing?
This clearly looks like a bug to me.
If others confirm, I have a patch ready :)
ValueError
in_pyio
on closed buffers #99009The text was updated successfully, but these errors were encountered: