diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-06-20 11:02:38 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-06-20 11:02:38 (GMT) |
commit | bc1f886170286291ad270d1935bd61151e398110 (patch) | |
tree | eb5ef3a5949160a92703699ecf2b326d5ea6628b /Python/getargs.c | |
parent | 32a4c7141911c58f01afe7b89482dbd4ce4f817f (diff) | |
download | cpython-bc1f886170286291ad270d1935bd61151e398110.zip cpython-bc1f886170286291ad270d1935bd61151e398110.tar.gz cpython-bc1f886170286291ad270d1935bd61151e398110.tar.bz2 |
Change %c format specifier for PyArg_ParseTuple() so that it accepts
a unicode character (an int * must be passed as the argument).
Change %c format specifier for Py_BuildValue() so that it outputs
a unicode object.
Fix datetime.datetime.isoformat(), so that it works if sep is
a unicode character > U+00FF.
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 7b27388..1730bff 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -761,15 +761,14 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, #endif /* WITHOUT_COMPLEX */ case 'c': {/* char */ - char *p = va_arg(*p_va, char *); + int *p = va_arg(*p_va, int *); if (PyString_Check(arg) && PyString_Size(arg) == 1) *p = PyString_AS_STRING(arg)[0]; else if (PyUnicode_Check(arg) && - PyUnicode_GET_SIZE(arg) == 1 && - PyUnicode_AS_UNICODE(arg)[0] < 256) + PyUnicode_GET_SIZE(arg) == 1) *p = PyUnicode_AS_UNICODE(arg)[0]; else - return converterr("char < 256", arg, msgbuf, bufsize); + return converterr("char", arg, msgbuf, bufsize); break; } |