# HG changeset patch # User ebadf # Date 1436463192 18000 # Thu Jul 09 12:33:12 2015 -0500 # Node ID abe7db1067ac36ab06c3215d938c036d100c49ef # Parent 2a8a39640aa219f8b1195805b1a391d40492d428 added test for decoding bug diff -r 2a8a39640aa2 -r abe7db1067ac Lib/test/test_compile.py --- a/Lib/test/test_compile.py Wed Jul 08 20:19:07 2015 -0700 +++ b/Lib/test/test_compile.py Thu Jul 09 12:33:12 2015 -0500 @@ -516,6 +516,16 @@ res = script_helper.run_python_until_end(fn)[0] self.assertIn(b"Non-UTF-8", res.err) + def test_yet_more_evil_still_undecodable(self): + # Issue TBD + src = b"\x7f\x00\x00\n''s\x01\xfd\n'S" + with tempfile.TemporaryDirectory() as tmpd: + fn = os.path.join(tmpd, "bad.py") + with open(fn, "wb") as fp: + fp.write(src) + res = script_helper.run_python_until_end(fn)[0] + self.assertIn(b"Non-UTF-8", res.err) + @support.cpython_only def test_compiler_recursion_limit(self): # Expected limit is sys.getrecursionlimit() * the scaling factor