Bug 1968737 - /usr/lib/python3.10/site-packages/slip/dbus/polkit.py: AttributeError: module 'collections' has no attribute 'Callable'
Summary: /usr/lib/python3.10/site-packages/slip/dbus/polkit.py: AttributeError: module...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-slip
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nils Philippsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2021-06-07 21:19 UTC by Miro Hrončok
Modified: 2021-06-07 21:37 UTC (History)
3 users (show)

Fixed In Version: python-slip-0.6.4-24.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-07 21:37:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Screenshot from OpenQA (16.60 KB, image/png)
2021-06-07 21:19 UTC, Miro Hrončok
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github nphilipp python-slip pull 7 0 None open Python 3.10+ fix: Use collections.abc.Callable instead of collections.Callable 2021-06-07 21:25:34 UTC

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


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