diff options
Diffstat (limited to 'Modules/spwdmodule.c')
| -rw-r--r-- | Modules/spwdmodule.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/spwdmodule.c b/Modules/spwdmodule.c index da452e9..96707b4 100644 --- a/Modules/spwdmodule.c +++ b/Modules/spwdmodule.c @@ -118,9 +118,7 @@ static PyObject* spwd_getspnam(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "U:getspnam", &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; |
