Bug 2273350 - breezy fails to run with Python 3.13: brz: ERROR: No module named 'cgi'
Summary: breezy fails to run with Python 3.13: brz: ERROR: No module named 'cgi'
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: breezy
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondřej Pohořelský
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-04-04 11:31 UTC by Karolina Surma
Modified: 2024-04-08 10:13 UTC (History)
7 users (show)

Fixed In Version: breezy-3.3.7-1.fc41
Clone Of:
Environment:
Last Closed: 2024-04-08 10:13:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-04-04 11:31:10 UTC
python-dunamai fails to build with Python 3.13.0a5.

__________________________ test__version__from_bazaar __________________________
[gw1] linux -- Python 3.13.0 /usr/bin/python3

tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test__version__from_bazaar0')

    @pytest.mark.skipif(shutil.which("bzr") is None, reason="Requires Bazaar")
    def test__version__from_bazaar(tmp_path) -> None:
        vcs = tmp_path / "dunamai-bzr"
        vcs.mkdir()
        run = make_run_callback(vcs)
        from_vcs = make_from_callback(Version.from_bazaar, clear=False)
        b = "dunamai-bzr"
    
        with chdir(vcs):
>           run("bzr init")

tests/integration/test_dunamai.py:767: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/integration/test_dunamai.py:56: in inner
    _, out = _run_cmd(command, where=where, codes=[expected_code], env=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

command = 'bzr init'
where = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test__version__from_bazaar0/dunamai-bzr')
codes = [0], shell = False, env = None

    def _run_cmd(
        command: str,
        where: Optional[Path],
        codes: Sequence[int] = (0,),
        shell: bool = False,
        env: Optional[dict] = None,
    ) -> Tuple[int, str]:
        result = subprocess.run(
            shlex.split(command),
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            cwd=str(where) if where is not None else None,
            shell=shell,
            env=env,
        )
        output = result.stdout.decode().strip()
        if codes and result.returncode not in codes:
>           raise RuntimeError(
                "The command '{}' returned code {}. Output:\n{}".format(
                    command, result.returncode, output
                )
            )
E           RuntimeError: The command 'bzr init' returned code 3. Output:
E           brz: ERROR: No module named 'cgi'
E           You may need to install this Python library separately.

../../BUILDROOT/python-dunamai-1.19.2-1.fc41.x86_64/usr/lib/python3.13/site-packages/dunamai/__init__.py:207: RuntimeError
=========================== short test summary info ============================
FAILED tests/integration/test_dunamai.py::test__version__from_bazaar - Runtim...
============ 1 failed, 58 passed, 1 skipped, 104 warnings in 49.04s ============


From https://docs.python.org/3.13/whatsnew/3.13.html:
PEP 594: The remaining 19 “dead batteries” have been removed from the standard library: aifc, audioop, cgi, cgitb, chunk, crypt, imghdr, mailcap, msilib, nis, nntplib, ossaudiodev, pipes, sndhdr, spwd, sunau, telnetlib, uu and xdrlib.


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

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

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 Sandro 2024-04-04 18:55:03 UTC
The error is coming from bzr itself. That is part of the breezy package, itself a Python package. Dunamai calls `bzr init` using subprocess.run().

To reproduce:

1. fedpkg --release rawhide mockbuild --no-cleanup-after --root python3.13-rawhide
2. mock --root python3.13-rawhide --shell
3. cd /tmp
4. mkdir bizaar
5. cd bizaar
6. bzr init

Result:

<mock-chroot> sh-5.2# bzr init
brz: ERROR: No module named 'cgi'
You may need to install this Python library separately.

I'm tempted to reassign to `breezy`, because that is where the problem is. But that would probably just lead to another bug filed against `python-dunamai` later on.

Karolina, what would you like me to do? Close, transfer to `breezy` or something else?

Comment 2 Sandro 2024-04-04 18:58:32 UTC
I forgot to mention, though it's probably self explanatory, `python3.13-rawhide` is my local mock config using the Python 3.13 Copr repo.

Comment 3 Karolina Surma 2024-04-05 07:08:53 UTC
Thank you for inspecting that! I'm reassigning to breezy and adding it to my bug creation ignore list.

Comment 4 Ondřej Pohořelský 2024-04-08 10:03:19 UTC
I've pushed updated Breezy to Rawhide that builds correctly with Python 3.13.
Could you please rebuild python-dunamai in the COPR, just to check that there is no other issue? Thank you!


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