import subprocess import sys import unittest from test import support class InvalidUTF8CharactersFromCommandLineTestCase(unittest.TestCase): def test_running_python_with_invalid_utf8_characters_passed_from_command_line(self): rc = subprocess.call(["python3.1", "-c", b"'\x80'"]) self.assertEqual(rc, 1) def test_main(): support.run_unittest(InvalidUTF8CharactersFromCommandLineTestCase) if __name__ == "__main__": test_main()