Closed
Labels
Description
Feature or enhancement
Python 3.13 alpha 1 removed the private _PyBytes_Join(sep, iterable) function which calls sep.join(iterable).
mypyc uses it. Since we already have PyUnicode_Join(sep, iterable), I propose to add a new PyBytes_Join() function.
In practice, it's just about renaming _PyBytes_Join() to PyBytes_Join().
Linked PRs
Reacted by Erlend E. Aasland and Marc Mueller
Activity
pythongh-121645: Add PyBytes_Join() function
pythongh-121645: Add PyBytes_Join() function
vstinner commentedon Jul 12, 2024
A code search on PyPI top 7,500 projects found 6 projects using the private
_PyBytes_Join()function:vstinner commentedon Jul 12, 2024
Sorry, I forgot to add a reference to the mypy issue: issue gh-121489.
ZeroIntensity commentedon Jul 12, 2024
Additionally, many repositories use
_PyBytes_Resizeas well. Perhaps that's something that should go public?vstinner commentedon Jul 13, 2024
IMO _PyBytes_Resize() is a bad pattern, it uses a bytes object which is incomplete/inconsistent: see capi-workgroup/api-evolution#36.
Instead, I created #121710: [C API] Add PyBytesWriter API.
pythongh-121645: Add PyBytes_Join() function
gh-121645: Add PyBytes_Join() function (#121646)
vstinner commentedon Aug 30, 2024
Implemented by the change 3d60dfb.
pythongh-121645: Fix typo in PyBytes_Join() doc
gh-121645: Fix typo in PyBytes_Join() doc (#123783)
[mypyc] Sync pythoncapi_compat.h (#17929)
[mypyc] Sync pythoncapi_compat.h (python#17929)
i-l-s-h-a-t commentedon Nov 10, 2025
Dear @vstinner,
I have an issue during my Python wheel generation on Linux, Python 3.13:
My code has numpy dependency and it uses pybind11 C++ library. I would like then to generate a wheel for it.
Could it be due to this renaming?
There is a check here but it checks only Python 3.14, and not 3.13:
I see there is a backward compatibility was assumed
As you can see it doesn't work in my case.
The whole log is here https://pastebin.com/Am07UcZg
I have this issue only for Python 3.13, only on Linux (docker image python:3.13). I tried to just install numpy and that works there. Looks like for my wheel creation, it does something else which fails.
And there is no such an issue on other Python versions (3.12 or 3.14) and Windows (Python 3.10-3.14).
I will appreciate you help.
Best,
ilshat
vstinner commentedon Nov 10, 2025
@i-l-s-h-a-t: Interesting bug. It's unrelated to Python, so can you please open an issue at https://github.com/python/pythoncapi-compat/issues? Please include commands on how to reproduce your issue.
i-l-s-h-a-t commentedon Nov 11, 2025
@vstinner Thank you for your reply. I created an issue there.
Although I could not reproduce the issue locally which appears in gitlab CI/CD.