From: Brett Cannon Date: Thu, 8 Jun 2006 16:24:56 +0000 (+0000) Subject: Backport change to binascii.hexlify() to use s# for its arguments instead of t# X-Git-Tag: v2.4.4c1~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbda788a51bae88f3cc956b7740634bfb2a46945;p=thirdparty%2FPython%2Fcpython.git Backport change to binascii.hexlify() to use s# for its arguments instead of t# in order to match its documentation. --- diff --git a/Misc/NEWS b/Misc/NEWS index 19a4750acc19..de45cdd8255e 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -19,6 +19,9 @@ Core and builtins Extension Modules ----------------- +- Change binascii.hexlify() to accept any read-only buffer and not just a char + buffer. + - Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder. - Calling Tk_Init twice is refused if the first call failed as that diff --git a/Modules/binascii.c b/Modules/binascii.c index bfb393f50307..95b5050a3626 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -908,7 +908,7 @@ binascii_hexlify(PyObject *self, PyObject *args) char* retbuf; int i, j; - if (!PyArg_ParseTuple(args, "t#:b2a_hex", &argbuf, &arglen)) + if (!PyArg_ParseTuple(args, "s#:b2a_hex", &argbuf, &arglen)) return NULL; retval = PyString_FromStringAndSize(NULL, arglen*2);