From 76f067aa7c6a60829f797178d6b8779d1a3a9a40 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Tue, 16 Dec 2025 18:38:37 +0100 Subject: [PATCH 1/2] Add regression test --- extra_tests/snippets/builtin_bytes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extra_tests/snippets/builtin_bytes.py b/extra_tests/snippets/builtin_bytes.py index 9347fbc8fab..01a11ccc588 100644 --- a/extra_tests/snippets/builtin_bytes.py +++ b/extra_tests/snippets/builtin_bytes.py @@ -1,3 +1,4 @@ +import sys from testutils import assert_raises, skip_if_unsupported # new @@ -611,6 +612,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" From 5f8b97aed4ba7eef9e134e9c3493fcfd19eb2514 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 16 Dec 2025 17:39:42 +0000 Subject: [PATCH 2/2] Auto-format: cargo fmt --all --- extra_tests/snippets/builtin_bytes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/extra_tests/snippets/builtin_bytes.py b/extra_tests/snippets/builtin_bytes.py index 01a11ccc588..4cb743baa6f 100644 --- a/extra_tests/snippets/builtin_bytes.py +++ b/extra_tests/snippets/builtin_bytes.py @@ -1,4 +1,5 @@ import sys + from testutils import assert_raises, skip_if_unsupported # new