Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1968737

Summary: /usr/lib/python3.10/site-packages/slip/dbus/polkit.py: AttributeError: module 'collections' has no attribute 'Callable'
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-slipAssignee: Nils Philippsen <nphilipp>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: nphilipp, thrnciar, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-slip-0.6.4-24.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-07 21:37:50 UTC Type: Bug
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: 1890881    
Attachments:
Description Flags
Screenshot from OpenQA none

Description Miro Hrončok 2021-06-07 21:19:05 UTC
Created attachment 1789292 [details]
Screenshot from OpenQA

Description of problem:
With the upgrade to Python 3.10, /usr/lib/python3.10/site-packages/slip/dbus/polkit.py has Python 3.10 incompatible code.

Line 106 has:

    assert(func is None or isinstance(func, collections.Callable))

And that leads to:

 AttributeError: module 'collections' has no attribute 'Callable' 

The deprecated aliases to Collections Abstract Base Classes were removed from the collections module in Python 3.10.
https://docs.python.org/3.10/whatsnew/changelog.html#python-3-10-0-alpha-5
https://bugs.python.org/issue37324

This does not prevent the package to build or install, presumably because it has no %check, but it fails the OpenQA tests of firewall-cmd.

See the attached screenshot.


Version-Release number of selected component (if applicable):
python-slip-0.6.4-23.fc35

How reproducible:
For example in mock.

Steps to Reproduce:

1. Get this mock config to ~/.config/mock/fedora-rawhide-python310_koji.cfg:

include('/etc/mock/fedora-rawhide-x86_64.cfg')

config_opts['root'] = 'fedora-rawhide-python310'

config_opts[f'{config_opts.package_manager}.conf'] += """

[koji-python3.10]
name=koji-python3.10
baseurl=http://kojipkgs.fedoraproject.org/repos/f35-python/latest/$basearch/
enabled=1
"""

EOF

2. Run:

$ mock -r fedora-rawhide-python310_koji --install /usr/bin/firewall-cmd
$ mock -r fedora-rawhide-python310_koji --shell
<mock-chroot> sh-5.1# firewall-cmd 
Traceback (most recent call last):
  File "/usr/bin/firewall-cmd", line 31, in <module>
    from firewall.client import FirewallClient, FirewallClientIPSetSettings, \
  File "/usr/lib/python3.10/site-packages/firewall/client.py", line 85, in <module>
    class FirewallClientZoneSettings(object):
  File "/usr/lib/python3.10/site-packages/firewall/client.py", line 310, in FirewallClientZoneSettings
    def addIcmpBlockInversion(self):
  File "/usr/lib/python3.10/site-packages/slip/dbus/polkit.py", line 106, in enable_proxy
    assert(func is None or isinstance(func, collections.Callable))
AttributeError: module 'collections' has no attribute 'Callable'

Comment 1 Miro Hrončok 2021-06-07 21:25:35 UTC
https://github.com/nphilipp/python-slip/pull/7