[Python-checkins] bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332)

Samuel Marks webhook-mailer at python.org
Mon Sep 21 04:35:34 EDT 2020

commit: c322948892438a387d752ec18d1eb512699a4d67
branch: master
author: Samuel Marks <807580+SamuelMarks at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-09-21T10:35:17+02:00

bpo-41819: Fix compiler warning in init_dump_ascii_wstr() (GH-22332)

Fix the compiler warning:

format specifies type `wint_t` (aka `int`) but the argument has type `unsigned int`

M Python/initconfig.c

diff --git a/Python/initconfig.c b/Python/initconfig.c
index 880e145ec031c..6a13dc52ed776 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -2674,7 +2674,7 @@ init_dump_ascii_wstr(const wchar_t *str)
         if (ch == L'\'') {
         } else if (0x20 <= ch && ch < 0x7f) {
-            PySys_WriteStderr("%lc", ch);
+            PySys_WriteStderr("%c", ch);
         else if (ch <= 0xff) {
             PySys_WriteStderr("\\x%02x", ch);

More information about the Python-checkins mailing list