Bug 2331343 - jc fails to build with Python 3.14: ImportError: cannot import name 'ByteString' from 'typing'
Summary: jc fails to build with Python 3.14: ImportError: cannot import name 'ByteStri...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: jc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michel Lind
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-12-10 11:26 UTC by Karolina Surma
Modified: 2025-02-15 17:55 UTC (History)
5 users (show)

Fixed In Version: jc-1.25.4-3.fc43
Clone Of:
Environment:
Last Closed: 2025-02-11 10:19:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources jc pull-request 2 0 None None None 2025-02-08 05:33:43 UTC
Github kellyjonbrazil jc pull 639 0 None open Adjust for removal of typing.ByteString in Python 3.14 2025-02-08 05:33:43 UTC

Description Karolina Surma 2024-12-10 11:26:00 UTC
jc fails to build with Python 3.14.0a2.

======================================================================
ERROR: tests.test_xrandr (unittest.loader._FailedTest.tests.test_xrandr)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_xrandr
Traceback (most recent call last):
  File "/usr/lib64/python3.14/unittest/loader.py", line 426, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib64/python3.14/unittest/loader.py", line 367, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/builddir/build/BUILD/jc-1.25.4-build/jc-1.25.4/tests/test_xrandr.py", line 7, in <module>
    from jc.parsers.xrandr import (
    ...<15 lines>...
    )
  File "/builddir/build/BUILD/jc-1.25.4-build/jc-1.25.4/jc/parsers/xrandr.py", line 196, in <module>
    from jc.parsers.pyedid.edid import Edid
  File "/builddir/build/BUILD/jc-1.25.4-build/jc-1.25.4/jc/parsers/pyedid/edid.py", line 7, in <module>
    from typing import ByteString
ImportError: cannot import name 'ByteString' from 'typing' (/usr/lib64/python3.14/typing.py)


According to https://docs.python.org/dev/whatsnew/3.14.html#typing

ByteString has been removed from both typing and collections.abc modules.
It had previously raised a DeprecationWarning since Python 3.12.


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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08333929-jc/

For all our attempts to build jc with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/jc/

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

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Michel Lind 2025-02-08 05:33:43 UTC
I put up PRs to fix this - Artur, please review - if it looks fine I can merge and build

Comment 2 Artur Frenszek-Iwicki 2025-02-08 05:50:08 UTC
Would you mind if I try to submit this upstream?

Comment 3 Michel Lind 2025-02-10 22:19:04 UTC
(In reply to Artur Frenszek-Iwicki from comment #2)
> Would you mind if I try to submit this upstream?

I already linked the upstream PR - https://github.com/kellyjonbrazil/jc/pull/639

Comment 4 Michel Lind 2025-02-10 22:20:12 UTC
Looks like upstream wants the type changed, I'll refresh the upstream and downstream PRs

Comment 5 Michel Lind 2025-02-10 22:30:07 UTC
I just refreshed both PRs. Local build is fine, waiting for the official build to finish

Comment 6 Artur Frenszek-Iwicki 2025-02-11 10:06:49 UTC
Bah. Bugzilla e-mail formatting isn't the most friendly and I completely missed the added link.
Looks like this solution will be accepted upstream, so I'll go ahead and merge the patch.

Comment 7 Fedora Update System 2025-02-11 10:15:04 UTC
FEDORA-2025-7daf53f0b6 (jc-1.25.4-3.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-7daf53f0b6

Comment 8 Fedora Update System 2025-02-11 10:19:39 UTC
FEDORA-2025-7daf53f0b6 (jc-1.25.4-3.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.


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