Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc9d474

Browse files
committed
#4542: On Windows, binascii.crc32 still accepted str as binary input.
This fixes test_binascii. Will backport to 3.0
1 parent bc2ce57 commit bc9d474

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Core and Builtins
1616
Library
1717
-------
1818

19+
- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
20+
the corresponding tests now pass.
21+
1922
- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because
2023
it was calling the wrong open() function.
2124

Modules/binascii.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ binascii_crc32(PyObject *self, PyObject *args)
10191019
Py_ssize_t len;
10201020
unsigned int result;
10211021

1022-
if ( !PyArg_ParseTuple(args, "s*|I:crc32", &pbin, &crc) )
1022+
if ( !PyArg_ParseTuple(args, "y*|I:crc32", &pbin, &crc) )
10231023
return NULL;
10241024
bin_data = pbin.buf;
10251025
len = pbin.len;

0 commit comments

Comments
 (0)