bpo-34604: Use %R because of invisible characters or trailing whitespaces. (GH-9165). (GH-10947)
(cherry picked from commit 34c7f0c04e2b4e715b2c3df1875af8939fbe7d0b)
Co-authored-by: William Grzybowski <wg@FreeBSD.org>
diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c
index 43e45ef..8a724b6 100644
--- a/Modules/grpmodule.c
+++ b/Modules/grpmodule.c
@@ -156,7 +156,7 @@
goto out;
if ((p = getgrnam(name_chars)) == NULL) {
- PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %S", name);
+ PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %R", name);
goto out;
}
retval = mkgrent(p);