Fix Py_UNICODE_TODECIMAL definition for PyPy#6078
Open
ngoldbaum wants to merge 2 commits into
Open
Conversation
04f8186 to
88d34b3
Compare
Co-authored-by: Bas Schoenmaeckers <7943856+bschoenmaeckers@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PyPy doesn't expose
_PyUnicode_ToDecimalDigit, so this definition leads to an unknown symbol error at link time. I'm not sure why the existing pypy tests didn't catch this. I was able to trigger it by running the maturin testintegration::integration_cases::case_16_pyo3_stub_generation_zigwith a zig compiler andpypy3.11-7.3.22installed on an ARM Mac.Py_UNICODE_TODECIMALis exposed in the PyPy C API, so we can just expose it directly: https://github.com/pypy/pypy/blob/872e7d92ee361276e84844b7fab208dc73c93a11/pypy/module/cpyext/unicodeobject.py#L186-L193That fixes the linker error for me in my local testing.