diff --git a/extra_tests/snippets/builtin_bytes.py b/extra_tests/snippets/builtin_bytes.py index 9347fbc8fab..4cb743baa6f 100644 --- a/extra_tests/snippets/builtin_bytes.py +++ b/extra_tests/snippets/builtin_bytes.py @@ -1,3 +1,5 @@ +import sys + from testutils import assert_raises, skip_if_unsupported # new @@ -611,6 +613,9 @@ assert b"\xc2\xae\x75\x73\x74".decode() == "®ust" assert b"\xe4\xb8\xad\xe6\x96\x87\xe5\xad\x97".decode("utf-8") == "中文字" +# gh-2391 +assert b"-\xff".decode(sys.getfilesystemencoding(), "surrogateescape") == "-\udcff" + # mod assert b"rust%bpython%b" % (b" ", b"!") == b"rust python!" assert b"x=%i y=%f" % (1, 2.5) == b"x=1 y=2.500000"