[Python-3000-checkins] r57512 - python/branches/py3k/Modules/_hashopenssl.c
guido.van.rossum
python-3000-checkins at python.org
Sun Aug 26 21:14:15 CEST 2007
Author: guido.van.rossum
Date: Sun Aug 26 21:14:15 2007
New Revision: 57512
Modified:
python/branches/py3k/Modules/_hashopenssl.c
Log:
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?
Modified: python/branches/py3k/Modules/_hashopenssl.c
==============================================================================
--- python/branches/py3k/Modules/_hashopenssl.c (original)
+++ python/branches/py3k/Modules/_hashopenssl.c Sun Aug 26 21:14:15 2007
@@ -158,7 +158,7 @@
"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) { \
More information about the Python-3000-checkins
mailing list