tests/unicode: Add test for invalid utf-8 file contents.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
parent
6c3d8d38bf
commit
bd4e45fd68
1
tests/unicode/data/utf-8_invalid.txt
Normal file
1
tests/unicode/data/utf-8_invalid.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
aa<EFBFBD>bb
|
5
tests/unicode/file_invalid.py
Normal file
5
tests/unicode/file_invalid.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
try:
|
||||||
|
f = open("unicode/data/utf-8_invalid.txt", encoding="utf-8")
|
||||||
|
f.read()
|
||||||
|
except UnicodeError:
|
||||||
|
print("UnicodeError")
|
Loading…
Reference in New Issue
Block a user