Skip to content

Commit 7d0ea60

Browse files
committed
Add a non-text encoding test
1 parent f484ce1 commit 7d0ea60

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/test/test_source_encoding.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,11 @@ def test_coding_spec_decode_error(self):
554554
b'print("\xc4\x85")\n')
555555
self.check_script_error(src, br"'shift_jis' codec can't decode byte")
556556

557+
def test_coding_spec_non_text_encoding(self):
558+
src = (b'# coding: hex_codec\n'
559+
b'print("Test")\n')
560+
self.check_script_error(src, br"'hex_codec' is not a text encoding")
561+
557562

558563
if __name__ == "__main__":
559564
unittest.main()

0 commit comments

Comments
 (0)