Bug 2022351 - kitty doesn't work with Python 3.11: Fatal Python error: Unknown value for option -X
Summary: kitty doesn't work with Python 3.11: Fatal Python error: Unknown value for op...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kitty
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Artem
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2021-11-11 12:19 UTC by Tomáš Hrnčiar
Modified: 2022-08-01 14:04 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-01 14:04:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-11-11 12:19:32 UTC
kitty fails to build with Python 3.11.0a2.

launcher.c:53:5: error: ‘PySys_AddXOption’ is deprecated [-Werror=deprecated-declarations]
   53 |     PySys_AddXOption(buf);
      |     ^~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:94,
                 from launcher.c:22:
/usr/include/python3.11/sysmodule.h:29:38: note: declared here
   29 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
      |                                      ^~~~~~~~~~~~~~~~
launcher.c:55:5: error: ‘PySys_AddXOption’ is deprecated [-Werror=deprecated-declarations]
   55 |     if (from_source) PySys_AddXOption(L"kitty_from_source=1");
      |     ^~
In file included from /usr/include/python3.11/Python.h:94,
                 from launcher.c:22:
/usr/include/python3.11/sysmodule.h:29:38: note: declared here
   29 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
      |                                      ^~~~~~~~~~~~~~~~
launcher.c:58:9: error: ‘PySys_AddXOption’ is deprecated [-Werror=deprecated-declarations]
   58 |         PySys_AddXOption(buf);
      |         ^~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:94,
                 from launcher.c:22:
/usr/include/python3.11/sysmodule.h:29:38: note: declared here
   29 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *);
      |                                      ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors


Deprecated
    Deprecate the following functions to configure the Python initialization:
        PySys_AddWarnOptionUnicode()
        PySys_AddWarnOption()
        PySys_AddXOption()
        PySys_HasWarnOptions()
        Py_SetPath()
        Py_SetProgramName()
        Py_SetPythonHome()
        Py_SetStandardStreamEncoding()
        _Py_SetProgramFullPath()
    Use the new PyConfig API of the Python Initialization Configuration instead (PEP 587). (Contributed by Victor Stinner in bpo-44113.)

https://bugs.python.org/issue44113
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/02939318-kitty/

For all our attempts to build kitty with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/kitty/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Cotton 2022-02-08 21:28:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 2 Miro Hrončok 2022-06-22 11:49:14 UTC
Closing this in bulk as it built with Python 3.11. If this needs to remain open for a followup, feel free to reopen, I won't close in bulk again.

Comment 3 Jan Pokorný [poki] 2022-08-01 11:53:31 UTC
There was a slightly heated exchange regarding Python's ability to
maintain documented compatibility going forward, and for the time being,
the following patch appears vital for a smooth Kitty run under
Fedora's Python 3.11:

  https://github.com/kovidgoyal/kitty/commit/f023f047ff48ec49dff628c024ea025331631b32

(doesn't apply cleanly at test.py, for my local build, I stuck with
"--without test" as a simplest way around)

Comment 4 Miro Hrončok 2022-08-01 12:43:23 UTC
(In reply to Jan Pokorný [poki] from comment #3)
> There was a slightly heated exchange regarding Python's ability to
> maintain documented compatibility going forward...

FTR, https://github.com/python/cpython/issues/89608

Comment 5 Miro Hrončok 2022-08-01 12:45:27 UTC
The Python change was reverted, this should work again with the rc1 release.

Comment 6 Yaroslav Sidlovsky 2022-08-01 13:11:49 UTC
I think that in this case python3 package should be patched until we get rc1.
It's simpler to patch 1 package instead all dependant packages.

Comment 7 Miro Hrončok 2022-08-01 13:12:44 UTC
What all dependent packages do you mean?

Comment 8 Yaroslav Sidlovsky 2022-08-01 13:13:28 UTC
Is kitty the only one package that has been affected by this issue?

Comment 9 Yaroslav Sidlovsky 2022-08-01 13:15:37 UTC
I mean "sys._xoptions breaking".

Comment 10 Miro Hrončok 2022-08-01 13:24:54 UTC
I think so.

Comment 11 Yaroslav Sidlovsky 2022-08-01 14:04:16 UTC
Should be fixed in latest build.


Note You need to log in before you can comment on or make changes to this bug.