diff options
author | William Grzybowski <wg@FreeBSD.org> | 2018-09-07 17:10:39 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2018-09-07 17:10:39 (GMT) |
commit | 28658485a54ad5f9df52ecc12d9046269f1654ec (patch) | |
tree | 37481555ef2aabc3af2c325ef4b6c6c65e2662ef /Modules/grpmodule.c | |
parent | 7e610bcdf128f61b925654e4fa80fbac83537d0e (diff) | |
download | cpython-28658485a54ad5f9df52ecc12d9046269f1654ec.zip cpython-28658485a54ad5f9df52ecc12d9046269f1654ec.tar.gz cpython-28658485a54ad5f9df52ecc12d9046269f1654ec.tar.bz2 |
bpo-34604: Fix possible mojibake in pwd.getpwnam() and grp.getgrnam() (GH-9098)
Pass the user/group name as Unicode to the formatting function,
instead of always decoding a bytes string from UTF-8.
Diffstat (limited to 'Modules/grpmodule.c')
-rw-r--r-- | Modules/grpmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c index ffdfa1b..74286ab 100644 --- a/Modules/grpmodule.c +++ b/Modules/grpmodule.c @@ -245,7 +245,7 @@ grp_getgrnam_impl(PyObject *module, PyObject *name) PyErr_NoMemory(); } else { - PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %s", name_chars); + PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %S", name); } goto out; } |