summaryrefslogtreecommitdiff
path: root/tests/io/file_readinto.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/io/file_readinto.py')
-rw-r--r--tests/io/file_readinto.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/io/file_readinto.py b/tests/io/file_readinto.py
index 7a0603377..cbefc6e04 100644
--- a/tests/io/file_readinto.py
+++ b/tests/io/file_readinto.py
@@ -5,3 +5,10 @@ print(b)
f = open("io/data/file2", "rb")
print(f.readinto(b))
print(b)
+
+# readinto() on writable file
+f = open('io/data/file1', 'ab')
+try:
+ f.readinto(bytearray(4))
+except OSError:
+ print('OSError')