Bug 2325443 - python-pydicom fails to build with Python 3.14: ImportError: cannot import name 'ByteString' from 'collections.abc'
Summary: python-pydicom fails to build with Python 3.14: ImportError: cannot import na...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pydicom
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ankur Sinha (FranciscoD)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-11-12 12:13 UTC by Karolina Surma
Modified: 2024-11-18 10:47 UTC (History)
5 users (show)

Fixed In Version: python-pydicom-3.0.1-7.fc42
Clone Of:
Environment:
Last Closed: 2024-11-18 10:47:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-pydicom pull-request 19 0 None None None 2024-11-18 09:57:20 UTC
Github pydicom pydicom issues 2172 0 None open pydicom fails to build with Python 3.14.0a1. 2024-11-12 12:25:41 UTC

Description Karolina Surma 2024-11-12 12:13:29 UTC
python-pydicom fails to build with Python 3.14.0a1.

Check import: pydicom
Traceback (most recent call last):
 ...
  File "/builddir/build/BUILD/python-pydicom-3.0.1-build/BUILDROOT/usr/lib/python3.14/site-packages/pydicom/__init__.py", line 31, in <module>
    from pydicom.dataelem import DataElement
  File "/builddir/build/BUILD/python-pydicom-3.0.1-build/BUILDROOT/usr/lib/python3.14/site-packages/pydicom/dataelem.py", line 17, in <module>
    from pydicom import config  # don't import datetime_conversion directly
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-pydicom-3.0.1-build/BUILDROOT/usr/lib/python3.14/site-packages/pydicom/config.py", line 407, in <module>
    import pydicom.pixel_data_handlers.numpy_handler as np_handler  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-pydicom-3.0.1-build/BUILDROOT/usr/lib/python3.14/site-packages/pydicom/pixel_data_handlers/__init__.py", line 6, in <module>
    from pydicom.pixels.processing import (
    ...<6 lines>...
    )
  File "/builddir/build/BUILD/python-pydicom-3.0.1-build/BUILDROOT/usr/lib/python3.14/site-packages/pydicom/pixels/__init__.py", line 3, in <module>
    from pydicom.pixels.decoders.base import get_decoder
  File "/builddir/build/BUILD/python-pydicom-3.0.1-build/BUILDROOT/usr/lib/python3.14/site-packages/pydicom/pixels/decoders/__init__.py", line 3, in <module>
    from pydicom.pixels.decoders.base import (
    ...<16 lines>...
    )
  File "/builddir/build/BUILD/python-pydicom-3.0.1-build/BUILDROOT/usr/lib/python3.14/site-packages/pydicom/pixels/decoders/base.py", line 21, in <module>
    from pydicom.pixels.common import (
    ...<5 lines>...
    )
  File "/builddir/build/BUILD/python-pydicom-3.0.1-build/BUILDROOT/usr/lib/python3.14/site-packages/pydicom/pixels/common.py", line 9, in <module>
    from pydicom.pixels.utils import as_pixel_options
  File "/builddir/build/BUILD/python-pydicom-3.0.1-build/BUILDROOT/usr/lib/python3.14/site-packages/pydicom/pixels/utils.py", line 4, in <module>
    from collections.abc import Iterable, Iterator, ByteString
ImportError: cannot import name 'ByteString' from 'collections.abc' (/usr/lib64/python3.14/_collections_abc.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/08211197-python-pydicom/

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

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 Ankur Sinha (FranciscoD) 2024-11-12 12:25:41 UTC
Filed issue upstream to begin with: https://github.com/pydicom/pydicom/issues/2172

Comment 2 Fedora Update System 2024-11-18 10:43:53 UTC
FEDORA-2024-c035e0adc7 (python-pydicom-3.0.1-7.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-c035e0adc7

Comment 3 Fedora Update System 2024-11-18 10:47:27 UTC
FEDORA-2024-c035e0adc7 (python-pydicom-3.0.1-7.fc42) has been pushed to the Fedora 42 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.