diff options
| author | William Grzybowski <wg@FreeBSD.org> | 2018-09-07 14:10:39 -0300 |
|---|---|---|
| committer | Victor Stinner <vstinner@redhat.com> | 2018-09-07 19:10:39 +0200 |
| commit | 28658485a54ad5f9df52ecc12d9046269f1654ec (patch) | |
| tree | 37481555ef2aabc3af2c325ef4b6c6c65e2662ef /Modules/grpmodule.c | |
| parent | 7e610bcdf128f61b925654e4fa80fbac83537d0e (diff) | |
| download | cpython-git-28658485a54ad5f9df52ecc12d9046269f1654ec.tar.gz | |
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 ffdfa1b6f9..74286ab397 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; } |
