Bug 2345519 - python-domdf-python-tools fails to build with Python 3.14: tests/test_words.py::test_alpha_sort - AssertionError: Regex pattern did not match.
Summary: python-domdf-python-tools fails to build with Python 3.14: tests/test_words.p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-domdf-python-tools
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Maxwell G
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14 F43FTBFS PYC3.14rc3 2391173
TreeView+ depends on / blocked
 
Reported: 2025-02-13 11:23 UTC by Karolina Surma
Modified: 2025-08-26 22:49 UTC (History)
4 users (show)

Fixed In Version: python-domdf-python-tools-3.9.0-7.fc44
Clone Of:
: 2391173 (view as bug list)
Environment:
Last Closed: 2025-08-26 22:49:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2025-02-13 11:23:37 UTC
python-domdf-python-tools fails to build with Python 3.14.05.

_______________________________ test_alpha_sort ________________________________

    def test_alpha_sort():
    	alphabet = f"_{string.ascii_uppercase}{string.ascii_lowercase}0123456789"
    
    	assert alpha_sort(["_hello", "apple", "world"], alphabet) == ["_hello", "apple", "world"]
    	assert alpha_sort(["apple", "_hello", "world"], alphabet) == ["_hello", "apple", "world"]
    	assert alpha_sort(["apple", "_hello", "world"], alphabet, reverse=True) == ["world", "apple", "_hello"]
    
    	with pytest.raises(ValueError, match="The character '☃' was not found in the alphabet."):
>   		alpha_sort(["apple", "_hello", "world", '☃'], alphabet)

tests/test_words.py:99: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
domdf_python_tools/words.py:180: in alpha_sort
    raise e
domdf_python_tools/words.py:174: in alpha_sort
    return sorted(iterable, key=lambda attr: [alphabet_.index(letter) for letter in attr], reverse=reverse)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

attr = '☃'

>   return sorted(iterable, key=lambda attr: [alphabet_.index(letter) for letter in attr], reverse=reverse)
E   ValueError: list.index(x): x not in list

domdf_python_tools/words.py:174: ValueError

During handling of the above exception, another exception occurred:

    def test_alpha_sort():
    	alphabet = f"_{string.ascii_uppercase}{string.ascii_lowercase}0123456789"
    
    	assert alpha_sort(["_hello", "apple", "world"], alphabet) == ["_hello", "apple", "world"]
    	assert alpha_sort(["apple", "_hello", "world"], alphabet) == ["_hello", "apple", "world"]
    	assert alpha_sort(["apple", "_hello", "world"], alphabet, reverse=True) == ["world", "apple", "_hello"]
    
>   	with pytest.raises(ValueError, match="The character '☃' was not found in the alphabet."):
E    AssertionError: Regex pattern did not match.
E     Regex: "The character '☃' was not found in the alphabet."
E     Input: 'list.index(x): x not in list'

tests/test_words.py:98: AssertionError

=========================== short test summary info ============================
FAILED tests/test_words.py::test_alpha_sort - AssertionError: Regex pattern did not match.

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/08650993-python-domdf-python-tools/

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

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 Miro Hrončok 2025-08-26 11:08:43 UTC
Hello. This is a bulk comment.

This package still needs to be rebuilt and/or shipped with Python 3.14.0rc2+ bytecode in Fedora 43.

The Beta Freeze of Fedora 43 is scheduled to start today. Please prioritize this bugzilla accordingly.

Thanks.

Comment 2 Maxwell G 2025-08-26 22:42:19 UTC
The original bug will be closed by the rawhide update, so I'm filing a new one to track a freeze exception request: https://bugzilla.redhat.com/show_bug.cgi?id=2391173

Comment 3 Fedora Update System 2025-08-26 22:47:24 UTC
FEDORA-2025-26e4b2c46e (python-domdf-python-tools-3.9.0-7.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-26e4b2c46e

Comment 4 Fedora Update System 2025-08-26 22:49:59 UTC
FEDORA-2025-26e4b2c46e (python-domdf-python-tools-3.9.0-7.fc44) has been pushed to the Fedora 44 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.