Bug 2246056

Summary: python-paste fails to build with Python 3.13: ModuleNotFoundError: No module named 'cgi'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-pasteAssignee: Aurelien Bompard <aurelien>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 40CC: aurelien, infra-sig, ksurma, mhroncok, ondrejj
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-16 19:14:38 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: 2244836    

Description Karolina Surma 2023-10-25 07:59:34 UTC
python-paste fails to build with Python 3.13.0a1.

________ ERROR collecting tests/test_exceptions/test_httpexceptions.py _________
ImportError while importing test module '/builddir/build/BUILD/Paste-3.7.1/tests/test_exceptions/test_httpexceptions.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_exceptions/test_httpexceptions.py:13: in <module>
    from paste.httpexceptions import *
paste/httpexceptions.py:78: in <module>
    from paste.wsgilib import catch_errors_app
paste/wsgilib.py:12: in <module>
    from paste.request import get_cookies, parse_querystring, parse_formvars
paste/request.py:20: in <module>
    import cgi
E   ModuleNotFoundError: No module named 'cgi'
=========================== short test summary info ============================
ERROR tests/test_cgiapp.py
ERROR tests/test_cgitb_catcher.py
ERROR tests/test_config.py
ERROR tests/test_errordocument.py
ERROR tests/test_fileapp.py
ERROR tests/test_fixture.py
ERROR tests/test_grantip.py
ERROR tests/test_gzipper.py
ERROR tests/test_httpheaders.py
ERROR tests/test_multidict.py
ERROR tests/test_profilemiddleware.py
ERROR tests/test_proxy.py
ERROR tests/test_recursive.py
ERROR tests/test_registry.py
ERROR tests/test_request.py
ERROR tests/test_request_form.py
ERROR tests/test_session.py
ERROR tests/test_urlmap.py
ERROR tests/test_urlparser.py
ERROR tests/test_wsgilib.py
ERROR tests/test_wsgiwrappers.py
ERROR tests/test_auth/test_auth_cookie.py
ERROR tests/test_auth/test_auth_digest.py
ERROR tests/test_auth/test_auth_tkt.py
ERROR tests/test_exceptions/test_error_middleware.py
ERROR tests/test_exceptions/test_httpexceptions.py
!!!!!!!!!!!!!!!!!!! Interrupted: 26 errors during collection !!!!!!!!!!!!!!!!!!!
============================== 26 errors in 1.41s ==============================

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/06561026-python-paste/

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

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 Jan ONDREJ 2023-10-25 16:28:22 UTC
Already reported upstream:
https://github.com/cdent/paste/issues/79

Comment 2 Jan ONDREJ 2023-11-04 07:15:40 UTC
Upstream has no active maintaining for this package, but this package is not required by python-paste-deploy, so I will leave this package if there will be no volunteer to make a patch.

Comment 3 Aoife Moloney 2024-02-15 23:01:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.