davidfoerster / aptsources-cleanup

Detects and interactively deactivates duplicate Apt source entries and deletes sources list files without valid enabled source entries (as requested in https://askubuntu.com/a/762815/175814).
MIT License
667 stars 85 forks source link

AttributeError: module 'collections.abc' has no attribute 'Collection' #33

Closed MitoCodeGithub closed 4 years ago

MitoCodeGithub commented 4 years ago

Moin David,

ich habe tatsächlich einen Fehler bei dem apt-sources-cleanup.pyz Skript:

Overlapping source entries:
 1. file '/etc/apt/sources.list.d/kubernetes.list':
    deb https://apt.kubernetes.io/ kubernetes-xenial main
 2. file '/etc/apt/sources.list.d/kubernetes.list':
    deb https://apt.kubernetes.io/ kubernetes-xenial main
I disabled all but the first entry.

1 source entry was disabled:
  deb https://apt.kubernetes.io/ kubernetes-xenial main
   deb https://apt.kubernetes.io/ kubernetes-xenial main

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "aptsources-cleanup.pyz/__main__.py", line 12, in <module>
  File "/usr/lib/python3.5/runpy.py", line 208, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "aptsources-cleanup.pyz/aptsources_cleanup/__main__.py", line 386, in <module>
  File "aptsources-cleanup.pyz/aptsources_cleanup/__main__.py", line 48, in main
  File "aptsources-cleanup.pyz/aptsources_cleanup/__main__.py", line 305, in handle_duplicates
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/gettext.py", line 323, in __init__
    VERSIONS = (0, 1)
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/gettext.py", line 381, in _get_string_transformer
    lastk = k
AttributeError: module 'collections.abc' has no attribute 'Collection'

MfG, Mito

davidfoerster commented 4 years ago

Thanks for the report! collections.abc.Collection is another Python standard library item introduced in v3.6 that I didn’t catch.

Fixed in release v0.1.7.5.

MitoCodeGithub commented 4 years ago

It looks like there's another issue:

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "aptsources-cleanup.pyz/__main__.py", line 12, in <module>
  File "/usr/lib/python3.5/runpy.py", line 201, in run_module
    mod_name, mod_spec, code = _get_module_details(mod_name)
  File "/usr/lib/python3.5/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "aptsources-cleanup.pyz/aptsources_cleanup/__init__.py", line 16, in <module>
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/import_check.py", line 5, in <module>
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/pkg.py", line 6, in <module>
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/gettext.py", line 11, in <module>
    """
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/collections/abc.py", line 9, in <module>
    def abstractmethod(funcobj):
ImportError: cannot import name '_check_methods'
davidfoerster commented 4 years ago

Sorry about that. Fixed in 6d50adc3cb80934a9c315e8e114f8c72154c41c4 and v0.1.7.5.1.