summaryrefslogtreecommitdiff
path: root/Modules/pwdmodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-10-27 05:40:06 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2007-10-27 05:40:06 +0000
commit3d7a90dea101021f846173b03b3d0a9c25a9d6b1 (patch)
treecc1c80afa1986881906f8012e0427dcba8a5fb67 /Modules/pwdmodule.c
parent8866e0ab58a549704818fb3bdc38a91e03d2180d (diff)
downloadcpython-git-3d7a90dea101021f846173b03b3d0a9c25a9d6b1.tar.gz
Get the locale and pwd tests working on the Solaris box where there
are some unicode values used. I'm not sure if this is the correct on all operating systems, but this works on Linux w/o unicode.
Diffstat (limited to 'Modules/pwdmodule.c')
-rw-r--r--Modules/pwdmodule.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index ea8c19cfd1..57f69e7c50 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);