Kaydet (Commit) a43cae3a authored tarafından Guido van Rossum's avatar Guido van Rossum

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?
üst a62db275
...@@ -158,7 +158,7 @@ EVP_hexdigest(EVPobject *self, PyObject *unused) ...@@ -158,7 +158,7 @@ EVP_hexdigest(EVPobject *self, PyObject *unused)
"object supporting the buffer API required"); \ "object supporting the buffer API required"); \
return NULL; \ return NULL; \
} \ } \
if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \ if (PyObject_GetBuffer((obj), (viewp), PyBUF_CHARACTER) == -1) { \
return NULL; \ return NULL; \
} \ } \
if ((viewp)->ndim > 1) { \ if ((viewp)->ndim > 1) { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment