From dbda788a51bae88f3cc956b7740634bfb2a46945 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 8 Jun 2006 16:24:56 +0000 Subject: [PATCH] Backport change to binascii.hexlify() to use s# for its arguments instead of t# in order to match its documentation. --- Misc/NEWS | 3 +++ Modules/binascii.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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); -- 2.47.3