Commit 73e24e80 authored by Stefan Behnel's avatar Stefan Behnel

fix ascii auto-encoding in Py3.3

parent 7c8810db
...@@ -16,6 +16,8 @@ Features added ...@@ -16,6 +16,8 @@ Features added
Bugs fixed Bugs fixed
---------- ----------
* Auto-encoding with ``c_string_encoding=ascii`` failed in Py3.3.
* Crash when subtyping freelist enabled Cython extension types with * Crash when subtyping freelist enabled Cython extension types with
Python classes that use ``__slots__``. Python classes that use ``__slots__``.
......
...@@ -192,7 +192,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_ ...@@ -192,7 +192,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
if (PyUnicode_IS_ASCII(o)) { if (PyUnicode_IS_ASCII(o)) {
// cached for the lifetime of the object // cached for the lifetime of the object
*length = PyUnicode_GET_DATA_SIZE(o); *length = PyUnicode_GET_LENGTH(o);
return PyUnicode_AsUTF8(o); return PyUnicode_AsUTF8(o);
} else { } else {
// raise the error // raise the error
......
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