Bug 1899950

Summary: python-cheetah fails to build with Python 3.10: ImportError: No module named _bootlocale
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-cheetahAssignee: Miro Hrončok <mhroncok>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: mhroncok, mikeb, mskalicky, panovotn, thrnciar, vstinner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-cheetah-3.2.4-6.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-07 20:14:45 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: 1890881    

Description Miro Hrončok 2020-11-20 12:57:08 UTC
python-cheetah fails to build with Python 3.10.0a2.

+ /builddir/build/BUILDROOT/python-cheetah-3.2.4-5.fc34.x86_64//usr/bin/cheetah test
.......E.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
======================================================================
ERROR: test_import_bootlocale (Cheetah.Tests.ImportHooks.ImportHooksTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILDROOT/python-cheetah-3.2.4-5.fc34.x86_64/usr/lib64/python3.10/site-packages/Cheetah/Tests/ImportHooks.py", line 95, in test_import_bootlocale
    import _bootlocale  # noqa: F401 '_bootlocale' imported but unused
  File "/builddir/build/BUILDROOT/python-cheetah-3.2.4-5.fc34.x86_64/usr/lib64/python3.10/site-packages/Cheetah/ImportManager.py", line 479, in importHook
    raise ImportError("No module named %s" % fqname)
ImportError: No module named _bootlocale

----------------------------------------------------------------------
Ran 2173 tests in 10.162s

FAILED (errors=1)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01773069-python-cheetah/

For all our attempts to build python-cheetah with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-cheetah/

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

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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 Tomáš Hrnčiar 2020-12-04 08:53:45 UTC
Hello, 

can we get any updates on this? 
It blocks plenty of packages in Python 3.10 COPR (https://copr.fedorainfracloud.org/coprs/g/python/python3.10/packages/):

    cobbler
    gnuradio
    gr-fcdproplus
    gr-hpsdr
    gr-iqbal
    uhd
    gr-osmosdr
    gr-rfd
    uhr

Thanks!

Comment 2 Victor Stinner 2021-01-19 10:25:32 UTC
I proposed a fix upstream: https://github.com/CheetahTemplate3/cheetah3/pull/32

Oh, _bootlocale was a private module which should not be imported directly. I removed it and replaced it with a new _locale._get_locale_encoding() function in Python 3.10:

* https://github.com/python/cpython/commit/b62bdf71ea0cd52041d49691d8ae3dc645bd48e1
* https://bugs.python.org/issue42208

Cheetah/Tests/ImportHooks.py: test_import_bootlocale(), line 95:
    import _bootlocale  # noqa: F401 '_bootlocale' imported but unused

This test should be either skipped or removed on Python 3.10. It was added by:

commit d9241f802160abee31e9bfe892e85770812bea75
Author: Oleg Broytman <phd>
Date:   Wed Sep 11 21:58:46 2019 +0300

    Fix(ImportManager): Fix infinite recursion

Comment 4 Ben Cotton 2021-02-09 16:12:11 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 5 Miro Hrončok 2021-06-04 20:12:52 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/