Skip to content

Commit 9d2dd17

Browse files
authored
Add regression test (#6452)
1 parent be559ae commit 9d2dd17

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

extra_tests/snippets/builtin_bytes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
from testutils import assert_raises, skip_if_unsupported
24

35
# new
@@ -611,6 +613,9 @@
611613
assert b"\xc2\xae\x75\x73\x74".decode() == "®ust"
612614
assert b"\xe4\xb8\xad\xe6\x96\x87\xe5\xad\x97".decode("utf-8") == "中文字"
613615

616+
# gh-2391
617+
assert b"-\xff".decode(sys.getfilesystemencoding(), "surrogateescape") == "-\udcff"
618+
614619
# mod
615620
assert b"rust%bpython%b" % (b" ", b"!") == b"rust python!"
616621
assert b"x=%i y=%f" % (1, 2.5) == b"x=1 y=2.500000"

0 commit comments

Comments
 (0)