From 5535f3f745761e53a6ff941b8ef74b5ceb13648f Mon Sep 17 00:00:00 2001 From: Yuki Liu Date: Fri, 15 Apr 2022 11:10:38 -0500 Subject: [PATCH 1/2] fix the comparison of character and integer by using ord() --- Tools/gdb/libpython.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 4f7a8bca5fd786..610d13099432cd 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -1418,7 +1418,7 @@ def write_repr(self, out, visited): out.write('\\r') # Map non-printable US ASCII to '\xhh' */ - elif ch < ' ' or ch == 0x7F: + elif ch < ' ' or ord(ch) == 0x7F: out.write('\\x') out.write(hexdigits[(ord(ch) >> 4) & 0x000F]) out.write(hexdigits[ord(ch) & 0x000F]) From 92d2671f9f6b17ebdcd18964153eaf92d073f7c7 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 16 Apr 2022 05:12:14 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2022-04-16-05-12-13.gh-issue-91595.CocJBv.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2022-04-16-05-12-13.gh-issue-91595.CocJBv.rst diff --git a/Misc/NEWS.d/next/Library/2022-04-16-05-12-13.gh-issue-91595.CocJBv.rst b/Misc/NEWS.d/next/Library/2022-04-16-05-12-13.gh-issue-91595.CocJBv.rst new file mode 100644 index 00000000000000..637079a6487a49 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-04-16-05-12-13.gh-issue-91595.CocJBv.rst @@ -0,0 +1 @@ +Fix the comparison of character and integer inside :func:`Tools.gdb.libpython.write_repr`. Patch by Yu Liu.