Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 1975260 - Broken import with sphinx4: ImportError: cannot import name 'force_decode' from 'sphinx.util'
Summary: Broken import with sphinx4: ImportError: cannot import name 'force_decode' fr...
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sphinxcontrib-httpdomain
Version: 35
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Dan Callaghan
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 1973718 1977664 1981749
TreeView+ depends on / blocked
Reported: 2021-06-23 11:00 UTC by Miroslav Suchý
Modified: 2021-08-23 07:28 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-08-23 07:28:09 UTC
Type: Bug

Attachments (Terms of Use)

Description Miroslav Suchý 2021-06-23 11:00:44 UTC
Description of problem:
With Sphinx4
the python3-sphinxcontrib-httpdomain raise a traceback when used in Sphinx.

In /usr/lib/python3.10/site-packages/sphinxcontrib/autohttp/
there is a line which cause this error:

>>> from sphinx.util import force_decode
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'force_decode' from 'sphinx.util' (/usr/lib/python3.10/site-packages/sphinx/util/

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. mock -r fedora-rawhide-x86_64 --addrepo= install python3-sphinxcontrib-httpdomain
2. python3 /usr/lib/python3.10/site-packages/sphinxcontrib/autohttp/

Actual results:

<mock-chroot> sh-5.1# python3 /usr/lib/python3.10/site-packages/sphinxcontrib/autohttp/
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/sphinxcontrib/autohttp/", line 22, in <module>
    from sphinx.util import force_decode
ImportError: cannot import name 'force_decode' from 'sphinx.util' (/usr/lib/python3.10/site-packages/sphinx/util/

Expected results:
no errors

Comment 1 Dan Callaghan 2021-07-19 12:07:52 UTC
Upstream issue:

Here is an unmerged PR, it seems to be from a drive-by contributor but the patch looks right to me:

Also worth noting that Sphinx appears to have re-added the deprecated `force_decode` function in 4.0.3, due to the number of extensions it broke. But they are still intending to remove it again in future.

Comment 2 Karolina Surma 2021-08-10 12:42:42 UTC
Sphinx was updated to 4.1.2 in Fedora Rawhide, this version contains the re-added `force_decode`. At the moment the issue shall be contained.

Comment 3 Ben Cotton 2021-08-10 13:08:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 4 Miroslav Suchý 2021-08-23 07:28:09 UTC
I verified it is working now.

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