Bug 2283616

Summary: xonsh fails to build with Python 3.13: ModuleNotFoundError: No module named 'cgi'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: xonshAssignee: Michel Lind <michel>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 41CC: blaise, fti-bugs, kparal, ksurma, mhroncok, michel, python-packagers-sig
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AcceptedFreezeException
Fixed In Version: xonsh-0.18.3-1.fc42 xonsh-0.18.3-1.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-10-17 23:10:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2260875, 2260877, 2244836, 2247868    

Description Karolina Surma 2024-05-28 08:20:17 UTC
xonsh fails to build with Python 3.13.0b1.

==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_xonfig.py _____________________
ImportError while importing test module '/builddir/build/BUILD/xonsh-0.14.1/tests/test_xonfig.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_xonfig.py:13: in <module>
    from xonsh.webconfig import main as web_main
../../BUILDROOT/xonsh-0.14.1-3.fc41.x86_64/usr/lib/python3.13/site-packages/xonsh/webconfig/main.py:2: in <module>
    import cgi
E   ModuleNotFoundError: No module named 'cgi'

According to https://docs.python.org/3.13/whatsnew/3.13.html module cgi was removed:

PEP 594: Remove the cgi and cgitb modules, deprecated in Python 3.11.

cgi.FieldStorage can typically be replaced with urllib.parse.parse_qsl() for GET and HEAD requests, and the email.message module or multipart PyPI project for POST and PUT.

cgi.parse() can be replaced by calling urllib.parse.parse_qs() directly on the desired query string, except for multipart/form-data input, which can be handled as described for cgi.parse_multipart().

cgi.parse_multipart() can be replaced with the functionality in the email package (e.g. email.message.EmailMessage and email.message.Message) which implements the same MIME RFCs, or with the multipart PyPI project.

cgi.parse_header() can be replaced with the functionality in the email package, which implements the same MIME RFCs. For example, with email.message.EmailMessage:

from email.message import EmailMessage
msg = EmailMessage()
msg['content-type'] = 'application/json; charset="utf8"'
main, params = msg.get_content_type(), msg['content-type'].params

(Contributed by Victor Stinner in gh-104773.)


https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07497433-xonsh/

For all our attempts to build xonsh with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/xonsh/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Karolina Surma 2024-06-12 15:12:14 UTC
*** Bug 2292022 has been marked as a duplicate of this bug. ***

Comment 2 Fedora Fails To Install 2024-06-19 19:59:53 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 3 Fedora Fails To Install 2024-07-13 08:02:16 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 4+ weeks.
This is the second reminder (step 4) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 4 Michel Lind 2024-07-25 19:00:56 UTC
This is removed in 0.18.2, I'll upgrade

https://github.com/xonsh/xonsh/commit/dd4d6f5c26734a568d068aa51d470dcabd0ab5c1

Comment 5 Karolina Surma 2024-09-04 15:07:49 UTC
This package has failed to build with Python 3.13 so far. Fedora 41 is already in the Beta Freeze phase. What's your plan going forward? Will the package be fixed in time for the Final Freeze of Fedora 41 (planned on Oct 15th 2024)?
If you don't plan or can't fix the package before Fedora 41 goes into the Final Freeze phase, please retire the package. You can unretire it anytime during the Fedora 41 lifecycle - doing this now will simply ensure that we don't release Fedora with a broken package. Thank you!

Comment 6 Michel Lind 2024-09-05 03:06:41 UTC
I'll fix it after the beta freeze - should not be too bad, but I don't have any cycles right now.

Comment 7 Miro Hrončok 2024-09-27 10:20:30 UTC
(In reply to Michel Lind from comment #6)
> I'll fix it after the beta freeze - should not be too bad, but I don't have
> any cycles right now.

Hello agian. Will you have time to fix the package in time for the Final Freeze of Fedora 41 (planned on Oct 15th 2024)?

Comment 8 Michel Lind 2024-09-29 03:14:08 UTC
(In reply to Miro Hrončok from comment #7)
> (In reply to Michel Lind from comment #6)
> > I'll fix it after the beta freeze - should not be too bad, but I don't have
> > any cycles right now.
> 
> Hello agian. Will you have time to fix the package in time for the Final
> Freeze of Fedora 41 (planned on Oct 15th 2024)?

Yes. sorry for the delay

Comment 9 Miro Hrončok 2024-10-11 11:26:23 UTC
https://github.com/xonsh/xonsh/pull/5306 remvoes the usage of cgi. It was released in 0.16.0. We have 0.14.1. The latest is 0.18.3.

Comment 11 Fedora Update System 2024-10-11 13:11:31 UTC
FEDORA-2024-71b2383f78 (xonsh-0.18.3-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-71b2383f78

Comment 12 Fedora Update System 2024-10-11 13:16:58 UTC
FEDORA-2024-de2fdeb888 (xonsh-0.18.3-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-de2fdeb888

Comment 13 Fedora Update System 2024-10-11 13:20:52 UTC
FEDORA-2024-de2fdeb888 (xonsh-0.18.3-1.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2024-10-12 03:12:21 UTC
FEDORA-2024-71b2383f78 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-71b2383f78`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-71b2383f78

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Kamil Páral 2024-10-14 17:57:08 UTC
Discussed at a blocker review meeting [1], agreed on the following:

All six proposed FEs - 2291477 , 2291818 , 2275052 , 2291961 , 2301218 , 2283616 - are accepted as they are fails-to-install bugs and by precedent we accept these if there are no unusual factors involved, to keep the frozen tree as installable as possible

[1] https://meetbot-raw.fedoraproject.org//meeting_matrix_fedoraproject-org/2024-10-14/

Comment 16 Fedora Update System 2024-10-17 23:10:55 UTC
FEDORA-2024-71b2383f78 (xonsh-0.18.3-1.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.