diff -r d5b0bb2a1790 Doc/c-api/arg.rst --- a/Doc/c-api/arg.rst Wed Dec 18 16:45:37 2013 +0200 +++ b/Doc/c-api/arg.rst Wed Dec 18 17:56:56 2013 +0200 @@ -201,9 +201,10 @@ .. versionadded:: 2.5 -``c`` (string of length 1) [char] - Convert a Python character, represented as a string of length 1, to a C - :c:type:`char`. +``c`` (string or Unicode of length 1) [char] + Convert a Python character, represented as a string or Unicode object of + length 1, to a C :c:type:`char`. Unicode object must contain ASCII + character (with code less 128). ``f`` (float) [float] Convert a Python floating point number to a C :c:type:`float`. diff -r d5b0bb2a1790 Python/getargs.c --- a/Python/getargs.c Wed Dec 18 16:45:37 2013 +0200 +++ b/Python/getargs.c Wed Dec 18 17:56:56 2013 +0200 @@ -824,6 +824,13 @@ char *p = va_arg(*p_va, char *); if (PyString_Check(arg) && PyString_Size(arg) == 1) *p = PyString_AS_STRING(arg)[0]; + else if (PyUnicode_Check(arg) && PyUnicode_GET_SIZE(arg) == 1) { + Py_UNICODE ch = PyUnicode_AS_UNICODE(arg)[0]; + if (ch < 128) + *p = (char)ch; + else + return converterr("char", arg, msgbuf, bufsize); + } else return converterr("char", arg, msgbuf, bufsize); break;