summaryrefslogtreecommitdiffstats
path: root/Modules/pwdmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/pwdmodule.c')
-rw-r--r--Modules/pwdmodule.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index 35a387a..b303f95 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -132,9 +132,7 @@ pwd_getpwnam(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "U:getpwnam", &arg))
return NULL;
- if ((bytes = PyUnicode_AsEncodedString(arg,
- Py_FileSystemDefaultEncoding,
- "surrogateescape")) == NULL)
+ if ((bytes = PyUnicode_EncodeFSDefault(arg)) == NULL)
return NULL;
if (PyBytes_AsStringAndSize(bytes, &name, NULL) == -1)
goto out;