Skip to content

Conversation

@yselkowitz
Copy link
Contributor

_PyObject_CallFunction_SizeT was dropped in Python 3.13:

python/cpython#105051

_PyObject_CallFunction_SizeT was dropped in Python 3.13:

python/cpython#105051

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
@k-takata k-takata changed the title runtime(python): fix compatibility with Python 3.13 python: fix compatibility with Python 3.13 Jun 23, 2024
@k-takata
Copy link
Member

k-takata commented Jun 23, 2024

Does this affect when the limited API is used?
(When Vim is compiled with the limited API, it should work both with Python 3.13 and Python 3.12 or earlier.)

@yselkowitz
Copy link
Contributor Author

PyObject_CallFunction is listed as part of the Limited API according to https://docs.python.org/3/c-api/stable.html#contents-of-limited-api but perhaps I didn't understand your question.

@zdohnal
Copy link
Contributor

zdohnal commented Jun 27, 2024

Hi @k-takata ,

what do you mean by "VIm compiled with limited API" - do you mean "dynamic" configure option value for --enable-python3interp? If you do, I would say the patch preserves using the old API for older Pythons and uses the new one for 3.13.
Please let us know how we could change the patch - VIm is currently not building in Fedora Rawhide, because new Python 3.13 came into the compose, so we would like to help with the fix.

@k-takata
Copy link
Member

@zdohnal I meant the --with-python3-stable-abi option. (Limited API == Stable ABI)
Ideally, if Vim is compiled with --enable-python3interp=dynamic --with-python3-stable-abi=3.8, it should work with any version of Python between 3.8 and 3.13.
This is mostly useful for Windows users, so we can include this PR for now, and can check the compatibility later (if it is difficult to check).

@zdohnal
Copy link
Contributor

zdohnal commented Jun 27, 2024

@k-takata the current Fedora releases have Python 3.12 and Centos Stream 9 has 3.9 - I've successfully built the current Vim on all mentioned platforms with the options you mentioned. Tried ':py3 print('hello')' in c9s and it worked. In Fedora, public tests which run Vim project test suite passed with the patch, so it looks good.

@chrisbra
Copy link
Member

chrisbra commented Jul 4, 2024

Thanks all.

@chrisbra chrisbra closed this in 4179f19 Jul 4, 2024
RestorerZ pushed a commit to RestorerZ/fork_vim-orig that referenced this pull request Jul 9, 2024
…hon 3.13

Problem:  if_py: _PyObject_CallFunction_SizeT is dropped in Python 3.13
Solution: define PyObject_CallFunction for Python >= 3.13
          (Yaakov Selkowitz)

references: python/cpython#105051

closes: vim#15088

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants