GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — `_io` and `_pyio` inconsistenly raise `ValueError`s on closed files · Issue #98999 · python/cpython Closed Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionWhile working on typeshed stubs, I've noticed that So, I went to see both implementation and tests.
cpython/Modules/_io/bufferedio.c Line 910 in 0689b99
But, tests were not executed correctly. Tests were only covering def test_read_on_closed(self): # Issue #23796 b = io.BufferedReader(io.BytesIO(b"12")) b.read(1) b.close() self.assertRaises(ValueError, b.peek) self.assertRaises(ValueError, b.read1, 1) While universal test would look like this: def test_read_on_closed(self): # Issue #23796 b = self.BufferedReader(self.BytesIO(b"12")) b.read(1) b.close() self.assertRaises(ValueError, b.peek) self.assertRaises(ValueError, b.read1, 1) And now it is failing: After that, I've tested other methods and here's a list of methods that work on closed in
Related https://bugs.python.org/issue23796 Is it a bug or a feature? Is it worth fixing? If others confirm, I have a patch ready :) Activity
MetadataMetadataAssigneesLabelsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions | ||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |