Bug 2238632 - straight/plugin/loaders.py: ModuleNotFoundError: No module named 'imp'
Summary: straight/plugin/loaders.py: ModuleNotFoundError: No module named 'imp'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-straight-plugin
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Pierre-YvesChibon
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2023-09-12 22:05 UTC by Miro Hrončok
Modified: 2023-09-22 00:18 UTC (History)
2 users (show)

Fixed In Version: python-straight-plugin-1.5.0-23.fc40 python-straight-plugin-1.5.0-23.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-22 00:18:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources python-straight-plugin pull-request 3 0 None None None 2023-09-12 22:22:43 UTC
Fedora Package Sources python-straight-plugin pull-request 4 0 None None None 2023-09-12 22:22:43 UTC
Github ironfroggy straight.plugin pull 30 0 None open Remove the import of imp.find_module. 2023-09-12 22:11:39 UTC

Description Miro Hrončok 2023-09-12 22:05:19 UTC
This package seems to be broken on Python 3.12, see e.g. this report in FedoraReview:

$ fedora-review -b 2237913
Traceback (most recent call last):
  File "/usr/bin/fedora-review", line 22, in <module>
    from FedoraReview.review_helper import ReviewHelper
  File "/usr/lib/python3.12/site-packages/FedoraReview/review_helper.py", line 34, in <module>
    from .checks import Checks, ChecksLister
  File "/usr/lib/python3.12/site-packages/FedoraReview/checks.py", line 28, in <module>
    from straight.plugin import load  # pylint: disable=F0401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/straight/plugin/__init__.py", line 1, in <module>
    from straight.plugin import loaders 
  File "/usr/lib/python3.12/site-packages/straight/plugin/loaders.py", line 7, in <module>
    from imp import find_module                                                                                                                                
ModuleNotFoundError: No module named 'imp'

https://pagure.io/FedoraReview/issue/493


The imp module was removed from Python 3.12 after a long deprecation period.

As a stop-gap measure, please Require python3-zombie-imp. To solve this, please migrate to https://docs.python.org/3/library/importlib.html

Thanks.

Reproducible: Always

Steps to Reproduce:
1. dnf install python3-straight-plugin
2. python3 -c 'import straight.plugin'
Actual Results:  
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.12/site-packages/straight/plugin/__init__.py", line 1, in <module>
    from straight.plugin import loaders
  File "/usr/lib/python3.12/site-packages/straight/plugin/loaders.py", line 7, in <module>
    from imp import find_module
ModuleNotFoundError: No module named 'imp'


Expected Results:  
No Traceback.

Comment 1 Miro Hrončok 2023-09-12 22:11:40 UTC
https://github.com/ironfroggy/straight.plugin/pull/30 suggests this is a stray import that may be removed.

I've fedpkg prepped the Fedora package and indeed, there is no usage of imp.find_module, just the import.

Backporting the PR (which was proposed upstream over a year ago) should fix this.

Comment 3 Fedora Update System 2023-09-13 08:45:57 UTC
FEDORA-2023-e907716fb1 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-e907716fb1

Comment 4 Fedora Update System 2023-09-13 08:46:37 UTC
FEDORA-2023-e907716fb1 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Fedora Update System 2023-09-13 08:51:00 UTC
FEDORA-2023-0859d1ebd1 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-0859d1ebd1

Comment 6 Fedora Update System 2023-09-14 01:46:42 UTC
FEDORA-2023-0859d1ebd1 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-0859d1ebd1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-0859d1ebd1

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2023-09-22 00:18:22 UTC
FEDORA-2023-0859d1ebd1 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


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