diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-02 21:02:48 (GMT) |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-02 21:02:48 (GMT) |
| commit | 2f89aa678549eae1557247a36ed9194af9a4f7b7 (patch) | |
| tree | b8de431ef79fb42ca92d8601977a8ab5ac533ca8 /Lib/test/test_bytes.py | |
| parent | 07431a302a3698bec8b9eb9debc9f630479141e3 (diff) | |
| download | cpython-2f89aa678549eae1557247a36ed9194af9a4f7b7.zip cpython-2f89aa678549eae1557247a36ed9194af9a4f7b7.tar.gz cpython-2f89aa678549eae1557247a36ed9194af9a4f7b7.tar.bz2 | |
#2538: bytes objects can only provide read-only buffers
Diffstat (limited to 'Lib/test/test_bytes.py')
| -rw-r--r-- | Lib/test/test_bytes.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 5bda935..230dbf4 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -453,6 +453,11 @@ class BaseBytesTest(unittest.TestCase): class BytesTest(BaseBytesTest): type2test = bytes + def test_buffer_is_readonly(self): + with open(sys.stdin.fileno(), "rb", buffering=0) as f: + self.assertRaises(TypeError, f.readinto, b"") + + class ByteArrayTest(BaseBytesTest): type2test = bytearray |
