Skip to content

Instantly share code, notes, and snippets.

@asvetlov
Created November 3, 2012 10:45
Show Gist options
  • Save asvetlov/4006992 to your computer and use it in GitHub Desktop.
Save asvetlov/4006992 to your computer and use it in GitHub Desktop.
def test_non_utf8(self):
# Issue #16218
with temp_dir() as script_dir:
script_basename = '\udcf1\udcea\udcf0\udce8\udcef\udcf2'
source = 'print("test output")\n'
script_name = _make_test_script(script_dir, script_basename, source)
if not __debug__:
run_args = ('-' + 'O' * sys.flags.optimize, script_name)
else:
run_args = (script_name,)
rc, out, _ = assert_python_ok(*run_args)
self.assertEqual(0, rc)
expected = ("test output" + os.linesep).encode('ascii')
self.assertEqual(expected, out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment