Skip to content

Commit 2460947

Browse files
committed
Fix syntax_non_utf8 test to not depend on locale encoding
Use explicit encoding='latin-1' so the test works regardless of the system locale (e.g. C/POSIX locale uses ASCII by default).
1 parent ccd4c67 commit 2460947

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extra_tests/snippets/syntax_non_utf8.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
dir_path = os.path.dirname(os.path.realpath(__file__))
66

77
with assert_raises(SyntaxError):
8-
with open(os.path.join(dir_path , "non_utf8.txt")) as f:
8+
with open(os.path.join(dir_path , "non_utf8.txt"), encoding="latin-1") as f:
99
eval(f.read())

0 commit comments

Comments
 (0)