Feature or enhancement
PEP 623
FYI the lxml project still uses uses deprecated functions:
src/lxml/parser.pxi: py_buffer_len = python.PyUnicode_GET_DATA_SIZE(utext) src/lxml/parser.pxi: c_len = python.PyUnicode_GET_DATA_SIZE(text) src/lxml/python.pxd: cdef Py_ssize_t PyUnicode_GET_DATA_SIZE(object ustring)
Compiler warnings on Python 3.11:
src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc’: src/lxml/etree.c:119132:5: warning: ‘PyUnicode_GET_DATA_SIZE’ is deprecated [-Wdeprecated-declarations] 119132 | __pyx_v_py_buffer_len = PyUnicode_GET_DATA_SIZE(__pyx_v_utext); | ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.11/unicodeobject.h:1042, from /usr/include/python3.11/Python.h:51, from src/lxml/etree.c:99: /usr/include/python3.11/cpython/unicodeobject.h:657:26: note: declared here 657 | static inline Py_ssize_t PyUnicode_GET_DATA_SIZE(PyObject *op) | ^~~~~~~~~~~~~~~~~~~~~~~ src/lxml/etree.c:119141:5: warning: ‘PyUnicode_AS_DATA’ is deprecated [-Wdeprecated-declarations] 119141 | __pyx_v_c_text = PyUnicode_AS_DATA(__pyx_v_utext); | ^~~~~~~~~~~~~~ /usr/include/python3.11/cpython/unicodeobject.h:691:27: note: declared here 691 | static inline const char* PyUnicode_AS_DATA(PyObject *op) | ^~~~~~~~~~~~~~~~~ src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree__parseDoc’: src/lxml/etree.c:125721:7: warning: ‘PyUnicode_GET_DATA_SIZE’ is deprecated [-Wdeprecated-declarations] 125721 | __pyx_v_c_len = PyUnicode_GET_DATA_SIZE(__pyx_v_text); | ^~~~~~~~~~~~~ /usr/include/python3.11/cpython/unicodeobject.h:657:26: note: declared here 657 | static inline Py_ssize_t PyUnicode_GET_DATA_SIZE(PyObject *op) | ^~~~~~~~~~~~~~~~~~~~~~~
gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)
Thank you for reporting. I reported it to lxml. https://bugs.launchpad.net/lxml/+bug/1973155
I tried to fix it but I don't have enough skill to write compile-time switch in Cython. If it is difficult to fix it soon, I will resurrect PyUnicode_AS_DATA and PyUnicode_GET_DATA_SIZE as dummy function that just raise an exception.
I tried to fix it but I don't have enough skill to write compile-time switch in Cython.
I wrote https://github.com/gevent/gevent/pull/1872/files which has conditional code depending on the Python version.
pythongh-92536: Doc update about Py_UNICODE removal
gh-92536: Doc update about Py_UNICODE removal (GH-92756)
gh-92536: Update unicode struct size to ensure MemoryError is raised (G…
Well done! That was a long journey ;-)
gh-92536: Mark PyUnicode_READY() argument as unused (#93011)
pythongh-92536: Argument Clinic no longer emits PyUnicode_READY()
pythongh-92536: Remove PyUnicode_READY() calls
gh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)
gh-92536: Remove PyUnicode_READY() calls (#105210)
python/cpython#92536: PEP 623: Remove wstr and legacy APIs from Unico…
gh-92536: Fix comment about number of unicode string types (#136439)
pythongh-92536: Fix comment about number of unicode string types (pyt…
Activity
vstinner commented on May 11, 2022
FYI the lxml project still uses uses deprecated functions:
Compiler warnings on Python 3.11:
src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc’: src/lxml/etree.c:119132:5: warning: ‘PyUnicode_GET_DATA_SIZE’ is deprecated [-Wdeprecated-declarations] 119132 | __pyx_v_py_buffer_len = PyUnicode_GET_DATA_SIZE(__pyx_v_utext); | ^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.11/unicodeobject.h:1042, from /usr/include/python3.11/Python.h:51, from src/lxml/etree.c:99: /usr/include/python3.11/cpython/unicodeobject.h:657:26: note: declared here 657 | static inline Py_ssize_t PyUnicode_GET_DATA_SIZE(PyObject *op) | ^~~~~~~~~~~~~~~~~~~~~~~ src/lxml/etree.c:119141:5: warning: ‘PyUnicode_AS_DATA’ is deprecated [-Wdeprecated-declarations] 119141 | __pyx_v_c_text = PyUnicode_AS_DATA(__pyx_v_utext); | ^~~~~~~~~~~~~~ /usr/include/python3.11/cpython/unicodeobject.h:691:27: note: declared here 691 | static inline const char* PyUnicode_AS_DATA(PyObject *op) | ^~~~~~~~~~~~~~~~~ src/lxml/etree.c: In function ‘__pyx_f_4lxml_5etree__parseDoc’: src/lxml/etree.c:125721:7: warning: ‘PyUnicode_GET_DATA_SIZE’ is deprecated [-Wdeprecated-declarations] 125721 | __pyx_v_c_len = PyUnicode_GET_DATA_SIZE(__pyx_v_text); | ^~~~~~~~~~~~~ /usr/include/python3.11/cpython/unicodeobject.h:657:26: note: declared here 657 | static inline Py_ssize_t PyUnicode_GET_DATA_SIZE(PyObject *op) | ^~~~~~~~~~~~~~~~~~~~~~~gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)
methane commented on May 12, 2022
Thank you for reporting.
I reported it to lxml. https://bugs.launchpad.net/lxml/+bug/1973155
I tried to fix it but I don't have enough skill to write compile-time switch in Cython.
If it is difficult to fix it soon, I will resurrect PyUnicode_AS_DATA and PyUnicode_GET_DATA_SIZE as dummy function that just raise an exception.
vstinner commented on May 12, 2022
I wrote https://github.com/gevent/gevent/pull/1872/files which has conditional code depending on the Python version.
pythongh-92536: Doc update about Py_UNICODE removal
gh-92536: Doc update about Py_UNICODE removal (GH-92756)
gh-92536: Update unicode struct size to ensure MemoryError is raised (G…
vstinner commented on May 19, 2022
Well done! That was a long journey ;-)
gh-92536: Mark PyUnicode_READY() argument as unused (#93011)
pythongh-92536: Argument Clinic no longer emits PyUnicode_READY()
pythongh-92536: Argument Clinic no longer emits PyUnicode_READY()
pythongh-92536: Argument Clinic no longer emits PyUnicode_READY()
pythongh-92536: Remove PyUnicode_READY() calls
pythongh-92536: Remove PyUnicode_READY() calls
pythongh-92536: Argument Clinic no longer emits PyUnicode_READY()
gh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)
gh-92536: Remove PyUnicode_READY() calls (#105210)
python/cpython#92536: PEP 623: Remove wstr and legacy APIs from Unico…
python/cpython#92536: PEP 623: Remove wstr and legacy APIs from Unico…
python/cpython#92536: PEP 623: Remove wstr and legacy APIs from Unico…
gh-92536: Fix comment about number of unicode string types (#136439)
pythongh-92536: Fix comment about number of unicode string types (pyt…
pythongh-92536: Fix comment about number of unicode string types (pyt…
pythongh-92536: Fix comment about number of unicode string types (pyt…
pythongh-92536: Fix comment about number of unicode string types (pyt…
pythongh-92536: Fix comment about number of unicode string types (pyt…