]> granicus.if.org Git - python/commitdiff
Make binascii.hexlify() use s# for its arguments instead of t# to actually
authorBrett Cannon <bcannon@gmail.com>
Thu, 8 Jun 2006 16:23:04 +0000 (16:23 +0000)
committerBrett Cannon <bcannon@gmail.com>
Thu, 8 Jun 2006 16:23:04 +0000 (16:23 +0000)
match its documentation stating it accepts any read-only buffer.

Misc/NEWS
Modules/binascii.c

index fea1a6a63d0fc5b931ded71ef98fd69bc2f9e327..6c1fddbc17b688c06e58d700b9cb5f8e3e0ed0cc 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -75,6 +75,9 @@ Core and builtins
 Extension Modules
 -----------------
 
+- Change binascii.hexlify to accept a read-only buffer instead of only a char
+  buffer and actually follow its documentation.
+
 - Fixed a potentially invalid memory access of CJKCodecs' shift-jis decoder.
 
 - Patch #1478788 (modified version): The functional extension module has
index 71a962452ecc4891975cb160f447b324cdc1f6bf..3b2c8b254cd3fb17300f83ff8c4d390a9aa881e2 100644 (file)
@@ -909,7 +909,7 @@ binascii_hexlify(PyObject *self, PyObject *args)
        char* retbuf;
        Py_ssize_t 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);