diff options
Diffstat (limited to 'Modules/pwdmodule.c')
-rw-r--r-- | Modules/pwdmodule.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index ea8c19c..57f69e7 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -48,8 +48,11 @@ static PyTypeObject StructPwdType; static void sets(PyObject *v, int i, const char* val) { - if (val) - PyStructSequence_SET_ITEM(v, i, PyUnicode_FromString(val)); + if (val) { + PyObject *o = + PyUnicode_DecodeUnicodeEscape(val, strlen(val), "strict"); + PyStructSequence_SET_ITEM(v, i, o); + } else { PyStructSequence_SET_ITEM(v, i, Py_None); Py_INCREF(Py_None); |