Bug 2216113 - rpmconf-1.1.9-1.fc39 crashes: AttributeError: module 'rpm' has no attribute 'setInterruptSafety'
Summary: rpmconf-1.1.9-1.fc39 crashes: AttributeError: module 'rpm' has no attribute '...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpmconf
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2187480 2219977
TreeView+ depends on / blocked
 
Reported: 2023-06-20 07:15 UTC by Petr Pisar
Modified: 2023-07-10 07:10 UTC (History)
3 users (show)

Fixed In Version: rpmconf-1.1.10-1.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-07 13:46:28 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources rpmconf pull-request 4 0 None None None 2023-06-20 07:16:05 UTC
Github xsuchy rpmconf pull 53 0 None open Use rpm.files instead of rpm.fi 2023-07-07 11:06:36 UTC

Description Petr Pisar 2023-06-20 07:15:48 UTC
After upgrading rpm to 4.18.91-1.fc39, rpmconf crashes:

# rpmconf -a --frontend=vimdiff
Traceback (most recent call last):
  File "/usr/sbin/rpmconf", line 25, in <module>
    from rpmconf import rpmconf
  File "/usr/lib/python3.11/site-packages/rpmconf/rpmconf.py", line 47, in <module>
    rpm.setInterruptSafety(False)
    ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'rpm' has no attribute 'setInterruptSafety'

This is due to an intentional changes in librpm API. A proposed fix is at <https://src.fedoraproject.org/rpms/rpmconf/pull-request/4>.

Reproducible: Always

Comment 1 Nathan Lutterman 2023-06-20 10:02:00 UTC
I hope this is helpful to report, but when I implement the proposed patch, a new error is introduced: 

# rpmconf -a
Traceback (most recent call last):
  File "/usr/sbin/rpmconf", line 105, in <module>
    main()
  File "/usr/sbin/rpmconf", line 95, in main
    rconf.run()
  File "/usr/lib/python3.11/site-packages/rpmconf/rpmconf.py", line 122, in run
    tested_files += self._handle_package(pkg_hdr)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/rpmconf/rpmconf.py", line 346, in _handle_package
    for conf_file in self.get_list_of_config(package):
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/rpmconf/rpmconf.py", line 159, in get_list_of_config
    files = rpm.fi(package) # pylint: disable=no-member
            ^^^^^^
AttributeError: module 'rpm' has no attribute 'fi'. Did you mean: 'fd'?

Comment 2 Petr Pisar 2023-07-07 11:06:37 UTC
Yes. rpm removed rpm.fi class in:

commit 742be88cd97d95bae356a93f17ec0595b610cee7
Author: Panu Matilainen <pmatilai>
Date:   Fri Apr 8 12:18:33 2022 +0300

    Drop the klunky and ugly rpm.fi python binding finally
    
    Update our lone test-case to use rpm.files instead

I posted a new patch to upstream at <https://github.com/xsuchy/rpmconf/pull/53>.

Comment 3 Miroslav Suchý 2023-07-07 13:46:28 UTC
Merged and built
https://koji.fedoraproject.org/koji/taskinfo?taskID=103045328

Thank you all.


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