Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal API _PyBytes_Join() is removed in Python 3.13 #30

Closed
musicinmybrain opened this issue Jan 23, 2024 · 2 comments · Fixed by #31
Closed

Internal API _PyBytes_Join() is removed in Python 3.13 #30

musicinmybrain opened this issue Jan 23, 2024 · 2 comments · Fixed by #31

Comments

@musicinmybrain
Copy link
Contributor

The internal CPython API function _PyBytes_Join() is removed in Python 3.13. You will need to find a substitute.

The most straightforward workaround is to just call the Python bytes.join method on the empty bytestring object we already have. Since this call happens only once at the end of GzipReader_readall, I suspect any added overhead should be negligible. I’ve tested this fix and will follow up with a PR.

See downstream Fedora Linux bug https://bugzilla.redhat.com/show_bug.cgi?id=2259627.

See also CPython issue python/cpython#106320 and specifically python/cpython#107144.

@rhpvorderman
Copy link
Contributor

Let me think about this for a bit. The alternative is to use _PyBytes_Resize on a bytes object.

Thanks for reporting the issue.

@musicinmybrain
Copy link
Contributor Author

Let me think about this for a bit. The alternative is to use _PyBytes_Resize on a bytes object.

OK! Since _PyBytes_Resize is documented, it is safe from this round of API removals even though it’s “private.”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants