]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport change to binascii.hexlify() to use s# for its arguments instead of t#
authorBrett Cannon <bcannon@gmail.com>
Thu, 8 Jun 2006 16:24:56 +0000 (16:24 +0000)
committerBrett Cannon <bcannon@gmail.com>
Thu, 8 Jun 2006 16:24:56 +0000 (16:24 +0000)
in order to match its documentation.

Misc/NEWS
Modules/binascii.c

index 19a4750acc19e5b3406060d7f1c56a13640d0211..de45cdd8255ee90b01a999643dcf0f430944581a 100644 (file)
--- 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
index bfb393f5030758f9bef249705724d405ba3f8611..95b5050a3626086e147be2a96ee83533577d8a97 100644 (file)
@@ -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);