From: Amaury Forgeot d'Arc Date: Fri, 5 Dec 2008 01:40:43 +0000 (+0000) Subject: #4542: On Windows, binascii.crc32 still accepted str as binary input. X-Git-Tag: v3.1a1~764 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc9d4749f2f2af4c81c6c088a32ca5672d58a571;p=thirdparty%2FPython%2Fcpython.git #4542: On Windows, binascii.crc32 still accepted str as binary input. This fixes test_binascii. Will backport to 3.0 --- diff --git a/Misc/NEWS b/Misc/NEWS index 15e3401c5971..87af173215b6 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -16,6 +16,9 @@ Core and Builtins Library ------- +- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input; + the corresponding tests now pass. + - Issue #4537: webbrowser.UnixBrowser would fail to open the browser because it was calling the wrong open() function. diff --git a/Modules/binascii.c b/Modules/binascii.c index 52bd6dcc11eb..51101b412a5b 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -1019,7 +1019,7 @@ binascii_crc32(PyObject *self, PyObject *args) Py_ssize_t len; unsigned int result; - if ( !PyArg_ParseTuple(args, "s*|I:crc32", &pbin, &crc) ) + if ( !PyArg_ParseTuple(args, "y*|I:crc32", &pbin, &crc) ) return NULL; bin_data = pbin.buf; len = pbin.len;