]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Pass PyBUF_CHARACTER instead of PyBUF_SIMPLE to PyObject_GetBuffer().
authorGuido van Rossum <guido@python.org>
Sun, 26 Aug 2007 19:14:15 +0000 (19:14 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 26 Aug 2007 19:14:15 +0000 (19:14 +0000)
This makes the failing tests (test_unicodedata and, on OSX, test_hashlib) pass.

XXX However, I'm not sure that this is the right thing to do;
this behavior means that Unicode strings are automatically hashed as their
UTF-8 encoding.  Is that what we want?

Modules/_hashopenssl.c

index eab190b756776031fa573b5daf6f45407e275ee2..9ee1b3db278d1a3d3d2ec18a2ebb2f22b6208718 100644 (file)
@@ -158,7 +158,7 @@ EVP_hexdigest(EVPobject *self, PyObject *unused)
                                     "object supporting the buffer API required"); \
                     return NULL; \
                 } \
-                if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \
+                if (PyObject_GetBuffer((obj), (viewp), PyBUF_CHARACTER) == -1) { \
                     return NULL; \
                 } \
                 if ((viewp)->ndim > 1) { \