mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-85524: Raise "UnsupportedOperation" on FileIO.readall (#141214)
io.UnsupportedOperation is a subclass of OSError and recommended by io.IOBase for this case; matches other read methods on io.FileIO.
This commit is contained in:
parent
909f76dab9
commit
6f988b08d1
4 changed files with 23 additions and 8 deletions
|
|
@ -125,6 +125,7 @@ def test_invalid_operations(self):
|
|||
self.assertRaises(exc, fp.readline)
|
||||
with self.open(os_helper.TESTFN, "wb", buffering=0) as fp:
|
||||
self.assertRaises(exc, fp.read)
|
||||
self.assertRaises(exc, fp.readall)
|
||||
self.assertRaises(exc, fp.readline)
|
||||
with self.open(os_helper.TESTFN, "rb", buffering=0) as fp:
|
||||
self.assertRaises(exc, fp.write, b"blah")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue