Skip to content

Commit bd4e45f

Browse files
jimmodpgeorge
authored andcommitted
tests/unicode: Add test for invalid utf-8 file contents.
Signed-off-by: Jim Mussared <[email protected]>
1 parent 6c3d8d3 commit bd4e45f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tests/unicode/data/utf-8_invalid.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aa�bb

tests/unicode/file_invalid.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
try:
2+
f = open("unicode/data/utf-8_invalid.txt", encoding="utf-8")
3+
f.read()
4+
except UnicodeError:
5+
print("UnicodeError")

0 commit comments

Comments
 (0)