Skip to content

Replace deprecated Py_Unicode_EncodeUTF8 in objToJSON.c #24221

Closed
@TomAugspurger

Description

@TomAugspurger

Warning when building the C extensions:

pandas/_libs/src/ujson/python/objToJSON.c:444:14: warning: 'PyUnicode_EncodeUTF8' is deprecated [-Wdeprecated-declarations]
    newObj = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(obj),
             ^
/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/include/python3.7m/unicodeobject.h:1324:7: note: 'PyUnicode_EncodeUTF8' has been
      explicitly marked deprecated here
    ) Py_DEPRECATED(3.3);
      ^
/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pyport.h:493:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))

newObj = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(obj),
PyUnicode_GET_SIZE(obj), NULL);

Metadata

Metadata

Assignees

No one assigned

    Labels

    DependenciesRequired and optional dependencies

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions