bpo-34604: Use %R because of invisible characters or trailing whitespaces. (GH-9165)
This commit is contained in:
parent
25d389789c
commit
34c7f0c04e
|
@ -1,2 +1,3 @@
|
|||
Fix possible mojibake in the error message of `pwd.getpwnam` and
|
||||
`grp.getgrnam`. Patch by William Grzybowski.
|
||||
`grp.getgrnam` using string representation because of invisible characters
|
||||
or trailing whitespaces. Patch by William Grzybowski.
|
||||
|
|
|
@ -247,7 +247,7 @@ grp_getgrnam_impl(PyObject *module, PyObject *name)
|
|||
PyErr_NoMemory();
|
||||
}
|
||||
else {
|
||||
PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %S", name);
|
||||
PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %R", name);
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ pwd_getpwnam_impl(PyObject *module, PyObject *name)
|
|||
}
|
||||
else {
|
||||
PyErr_Format(PyExc_KeyError,
|
||||
"getpwnam(): name not found: %S", name);
|
||||
"getpwnam(): name not found: %R", name);
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue