Bug 2220636

Summary: dblatex: importlib has no attribute machinery
Product: [Fedora] Fedora Reporter: Jerry James <loganjerry>
Component: dblatexAssignee: Michael J Gruber <mjg>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: alex, jchaloup, mjg, ndbecker2
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dblatex-0.3.12-14.fc39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-06 14:06:11 UTC Type: ---
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: 2219969    

Description Jerry James 2023-07-05 20:49:45 UTC
The cxxtest build is failing because dblatex fails to produce a PDF.  Adding a -D argument to get a backtrace shows:

[mockbuild@dcc5c8bedcb54a5e8117418fe57a9ab6 doc]$ dblatex -D -t pdf -p "/usr/lib/python3.12/site-packages/asciidoc/resources/dblatex/asciidoc-dblatex.xsl" -s "/usr/lib/python3.12/site-packages/asciidoc/resources/dblatex/asciidoc-dblatex.sty" -P latex.output.revhistory=0 -P doc.collab.show=1 -P toc.section.depth=2 -V  "/builddir/build/BUILD/cxxtest-4.4/doc/guide.xml"
Error: module 'importlib' has no attribute 'machinery'
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/dbtexmf/core/dbtex.py", line 572, in run_setup
    run.set_xslt(options.xslt)
  File "/usr/lib/python3.12/site-packages/dbtexmf/core/dbtex.py", line 185, in set_xslt
    self.xsltproc = xslt.load(xsltmod)
                    ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/dbtexmf/xslt/xslt.py", line 10, in load
    spec = importlib.machinery.PathFinder.find_spec(modname, [""])
           ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'importlib' has no attribute 'machinery'

I see the use of importlib.machinery in 3 files belonging to dblatex:
- %{python3_sitelib}/dbtexmf/core/dbtex.py
- %{python3_sitelib}/dbtexmf/dblatex/grubber/plugins.py
- %{python3_sitelib}/dbtexmf/xslt/xslt.py

All 3 have an "import importlib" statement, but are lacking "import importlib.machinery", which fixes the error.  All 3 also need "import importlib.util" to fix the next error.

Reproducible: Always

Steps to Reproduce:
1. Try to build cxxtest in Rawhide
2.
3.
Actual Results:  
The build fails because dblatex fails to produce a PDF.

Expected Results:  
The PDF should be produced.

Comment 1 Fedora Update System 2023-07-06 13:51:30 UTC
FEDORA-2023-3004fcbcb6 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-3004fcbcb6

Comment 2 Michael J Gruber 2023-07-06 13:55:43 UTC
Thanks for the clear report, JJ!

I feel we are tracking down py 3.12 issues one by one, due to the lack of a porting guide (and, in some cases, of tests).

Comment 3 Fedora Update System 2023-07-06 14:06:11 UTC
FEDORA-2023-3004fcbcb6 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Jerry James 2023-07-06 14:09:38 UTC
Yes, it's been kind of a rough journey.  But we're making progress!  Thanks for the quick fix.