]> granicus.if.org Git - python/commitdiff
#4542: On Windows, binascii.crc32 still accepted str as binary input.
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Fri, 5 Dec 2008 01:40:43 +0000 (01:40 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Fri, 5 Dec 2008 01:40:43 +0000 (01:40 +0000)
This fixes test_binascii.

Will backport to 3.0

Misc/NEWS
Modules/binascii.c

index 15e3401c59716b450be2d53b2d642d437ea65612..87af173215b6686cc882993635716dc197abd01b 100644 (file)
--- 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.
 
index 52bd6dcc11eb3e2242f42d37cbdb2ea381270f66..51101b412a5bbb797d6eef2bf2c960f495d5c7cb 100644 (file)
@@ -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;