Bug 2221585 - clang-analyzer: cannot run scan-view after python 3.12 update
Summary: clang-analyzer: cannot run scan-view after python 3.12 update
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: clang
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Tulio Magno Quites Machado Filho
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-10 08:05 UTC by Jesus Checa
Modified: 2023-10-02 17:52 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-10-02 17:52:33 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jesus Checa 2023-07-10 08:05:11 UTC
After python has been updated to 3.12 in rawhide, running scan-view from clang-analyzer package fails to run, printing a traceback that states that module "imp" cannot be imported. This is caused because (https://docs.python.org/3.12/whatsnew/3.12.html) "The imp module has been removed. (Contributed by Barry Warsaw in gh-98040.)"


Reproducible: Always

Steps to Reproduce:
1.$ podman run -ti fedora:rawhide bash 
2.[container] # dnf install -y clang-analyzer
3.[container] # scan-view --help
Actual Results:  
[root@ffd9611a171e /]# scan-view --help
Traceback (most recent call last):
  File "/usr/bin/scan-view", line 9, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'

Expected Results:  
Regular scan-view's help output.

The "imp" module seems to be unused in scan-view (as of clang-16), so it might be easy to fix just by removing the import statement:
[root@ffd9611a171e /]# pyflakes /usr/bin/scan-view 
/usr/bin/scan-view:9:1: 'imp' imported but unused
/usr/bin/scan-view:18:1: 'webbrowser' imported but unused
/usr/bin/scan-view:43:5: redefinition of unused 'webbrowser' from line 18

Comment 1 Tulio Magno Quites Machado Filho 2023-07-10 12:17:42 UTC
I'm working on the update to LLVM 16.0.6, which should also fix this.

Comment 2 Fedora Update System 2023-07-11 12:22:03 UTC
FEDORA-2023-afd7a38128 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-afd7a38128

Comment 3 Jesus Checa 2023-07-12 10:45:10 UTC
I have tested the updated package from bodhi, unfortunately it seems the issue is still reproducible:

[root@ibm-z-109 ~]# rpm -q clang
clang-16.0.6-1.fc39.s390x
[root@ibm-z-109 ~]# scan-view --help
Traceback (most recent call last):
  File "/usr/bin/scan-view", line 9, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
[root@ibm-z-109 ~]# grep -Hn "import imp" `which scan-view`
/usr/bin/scan-view:9:import imp

Comment 4 Tulio Magno Quites Machado Filho 2023-07-13 14:39:00 UTC
I proposed a fix in this pull request: https://src.fedoraproject.org/rpms/clang/pull-request/208

Comment 5 Tulio Magno Quites Machado Filho 2023-07-14 17:54:00 UTC
The fix has been merged and is now available on https://bodhi.fedoraproject.org/updates/FEDORA-2023-afd7a38128

Comment 6 Fedora Update System 2023-07-18 20:30:58 UTC
FEDORA-2023-afd7a38128 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Release Engineering 2023-08-16 08:12:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


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