From: Guido van Rossum Date: Sun, 26 Aug 2007 19:14:15 +0000 (+0000) Subject: Pass PyBUF_CHARACTER instead of PyBUF_SIMPLE to PyObject_GetBuffer(). X-Git-Tag: v3.0a1~232 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a43cae3a0776f5dcbd2a54a0984cdff97e757cae;p=thirdparty%2FPython%2Fcpython.git Pass PyBUF_CHARACTER instead of PyBUF_SIMPLE to PyObject_GetBuffer(). 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? --- diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index eab190b75677..9ee1b3db278d 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -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) { \