GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Schedule removal of PyUnicode_AsDecoded/Encoded functions · Issue #132798 · python/cpython

Schedule removal of PyUnicode_AsDecoded/Encoded functions #132798

New issue
Copy link
New issue
Copy link
Closed
Closed
Schedule removal of PyUnicode_AsDecoded/Encoded functions#132798
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@StanFromIreland
StanFromIreland
opened on Apr 22, 2025
Issue body actions
  • PyUnicode_AsDecodedObject
  • PyUnicode_AsDecodedUnicode
  • PyUnicode_AsEncodedUnicode
  • PyUnicode_AsEncodedObject

Were deprecated in 3.6 in 0093907 by @serhiy-storchaka

They have no documentation.

Will schedule them for removal in 3.15 as suggested by @vstinner in #46236 (comment)

Linked PRs

  • gh-132798: Schedule removal of PyUnicode_AsDecoded/Encoded functions for 3.15 #132799

Activity

  1. ZeroIntensity
    added
    topic-C-API
    on Apr 22, 2025
  2. hugovk commented on Apr 22, 2025

    @hugovk
    hugovk
    on Apr 22, 2025
    Member
    More actions

    Will schedule them for removal in 3.15 as suggested by @vstinner in #46236 (comment)

    Before we schedule it, remember to do a code search first:

    IMO now it's too late for the 3.14 release cycle. It would be better to schedule such removal at the start of a new dev cycle, such as Python 3.15. Someone also has to check if these functions are used in the wild (ex: run a code search).

    Please can you do this?

    For example, GitHub code search, https://grep.app, or https://hugovk.dev/blog/2022/how-to-search-5000-python-projects/.

  3. StanFromIreland commented on Apr 22, 2025

    @StanFromIreland
    StanFromIreland
    on Apr 22, 2025
    MemberAuthor
    More actions

    I did a (github) code search and found no recent uses. (Some (~4 for each) old repositories that have not been updated in the last ~8 years.)

  4. vstinner commented on Apr 22, 2025

    @vstinner
    vstinner
    on Apr 22, 2025
    Member
    More actions

    A code search on PyPI top 8,000 PyPI projects found matches in 2 projects:

    • nanobind (2.4.0)
    • orjson (3.10.15)

    I used the regex: PyUnicode_AsDecodedObject|PyUnicode_AsDecodedUnicode|PyUnicode_AsEncodedUnicode|PyUnicode_AsEncodedObject.

    nanobind-2.4.0.tar.gz: nanobind-2.4.0/cmake/darwin-ld-cpython.sym: -U _PyUnicode_AsDecodedObject
    nanobind-2.4.0.tar.gz: nanobind-2.4.0/cmake/darwin-ld-cpython.sym: -U _PyUnicode_AsDecodedUnicode
    nanobind-2.4.0.tar.gz: nanobind-2.4.0/cmake/darwin-ld-cpython.sym: -U _PyUnicode_AsEncodedObject
    nanobind-2.4.0.tar.gz: nanobind-2.4.0/cmake/darwin-ld-cpython.sym: -U _PyUnicode_AsEncodedUnicode
    nanobind-2.4.0.tar.gz: nanobind-2.4.0/cmake/darwin-ld-pypy.sym: -U _PyPyUnicode_AsEncodedObject
    
    orjson-3.10.15.tar.gz: orjson-3.10.15/include/pyo3/pyo3-ffi/src/unicodeobject.rs: pub fn PyUnicode_AsDecodedObject(
    orjson-3.10.15.tar.gz: orjson-3.10.15/include/pyo3/pyo3-ffi/src/unicodeobject.rs: pub fn PyUnicode_AsDecodedUnicode(
    orjson-3.10.15.tar.gz: orjson-3.10.15/include/pyo3/pyo3-ffi/src/unicodeobject.rs: #[cfg_attr(PyPy, link_name = "PyPyUnicode_AsEncodedObject")]
    orjson-3.10.15.tar.gz: orjson-3.10.15/include/pyo3/pyo3-ffi/src/unicodeobject.rs: pub fn PyUnicode_AsEncodedObject(
    orjson-3.10.15.tar.gz: orjson-3.10.15/include/pyo3/pyo3-ffi/src/unicodeobject.rs: pub fn PyUnicode_AsEncodedUnicode(
    

    It seems safe to remove these functions.

  5. picnixz
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Apr 24, 2025
  6. methane commented on Apr 25, 2025

    @methane
    methane
    on Apr 25, 2025
    Member
    More actions

    I am OK. But they are stable ABI. We need to convert them into abi only stable abi function that raise RuntimeError.

  7. vstinner commented on Apr 25, 2025

    @vstinner
    vstinner
    on Apr 25, 2025
    Member
    More actions

    I am OK. But they are stable ABI. We need to convert them into abi only stable abi function that raise RuntimeError.

    This change doesn't remove functions, it only schedules the removal.

    For the API removal, we can keep the functions unchanged in the stable ABI. There is no need to raise RuntimeError.

  8. vstinner
    added a commit that references this issue on Apr 25, 2025

    gh-132798: Schedule removal of `PyUnicode_AsDecoded/Encoded` function…

    f6fb498
  9. vstinner
    closed this as completedon Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.