Skip to content

Commit

Permalink
[3.12] Parser raises SyntaxError on null bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
netromdk committed Jul 9, 2023
1 parent 89f362c commit cefdaa3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,17 @@ def test_process_syntax_error(self):
self.assertEmpty(proc_res.text)
self.assertEmpty(proc_res.bps)

@VerminTest.skipUnlessVersion(3, 12)
def test_process_syntax_error_null_bytes(self):
# SyntaxError: source code string cannot contain null bytes
fp = ScopedTemporaryFile()
fp.write(b'\0')
fp.close()
proc_res = Processor.process_individual((fp.path(), self.config))
self.assertEqual(proc_res.mins, [(0, 0), (0, 0)])
self.assertEmpty(proc_res.text)
self.assertEmpty(proc_res.bps)

def test_process_invalid_versions(self):
with ScopedTemporaryFile() as fp:
fp.write(b"""long(42)
Expand Down

0 comments on commit cefdaa3

Please sign in to comment.