Bug 2220636 - dblatex: importlib has no attribute machinery
Summary: dblatex: importlib has no attribute machinery
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dblatex
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Michael J Gruber
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2219969
TreeView+ depends on / blocked
 
Reported: 2023-07-05 20:49 UTC by Jerry James
Modified: 2023-07-06 14:09 UTC (History)
4 users (show)

Fixed In Version: dblatex-0.3.12-14.fc39
Clone Of:
Environment:
Last Closed: 2023-07-06 14:06:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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