--- /dev/null
+Fix possible mojibake in the error message of `pwd.getpwnam` and
+`grp.getgrnam` using string representation because of invisible characters
+or trailing whitespaces. Patch by William Grzybowski.
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);
goto out;
if ((p = getpwnam(name)) == NULL) {
PyErr_Format(PyExc_KeyError,
- "getpwnam(): name not found: %S", arg);
+ "getpwnam(): name not found: %R", arg);
goto out;
}
retval = mkpwent(p);