Bug 1899950 - python-cheetah fails to build with Python 3.10: ImportError: No module named _bootlocale [NEEDINFO]
Summary: python-cheetah fails to build with Python 3.10: ImportError: No module named ...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-cheetah
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Mike Bonnet
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-11-20 12:57 UTC by Miro Hrončok
Modified: 2021-02-09 16:23 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
thrnciar: needinfo? (mikeb)


Attachments (Terms of Use)

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@phdru.name>
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.


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