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

Issue running the script #31

Closed usamazf closed 4 years ago

usamazf commented 4 years ago

I tried the instructions from the answer on stackoverflow to clean duplicate entries issue using this script, but when I try to run it I get following issue:

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, 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 199, 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 387, in <module>
  File "aptsources-cleanup.pyz/aptsources_cleanup/__main__.py", line 36, in main
  File "aptsources-cleanup.pyz/aptsources_cleanup/__main__.py", line 202, in parse_args
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/functools.py", line 140, in <lambda>
    if op_result is NotImplemented:
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/functools.py", line 94, in _get_instance
    # infinite recursion that could occur when the operator dispatch logic
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/gettext.py", line 133, in _make_translations
    codeset = ''
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/gettext.py", line 110, in translation

  File "aptsources-cleanup.pyz/aptsources_cleanup/util/zipfile.py", line 38, in open

  File "aptsources-cleanup.pyz/aptsources_cleanup/util/zipfile.py", line 27, in getinfo
    crc32 = binascii.crc32
  File "aptsources-cleanup.pyz/aptsources_cleanup/util/zipfile.py", line 63, in _resolve_path
    ZIP_BZIP2 = 12
AttributeError: module 'os' has no attribute 'fspath'
davidfoerster commented 4 years ago

I see. Python v3.5 has no os.fspath method although it’s still in use and under support in Ubuntu Xenial. That’s a quick fix. I’ll try to look for other missing methods while I’m at it.

davidfoerster commented 4 years ago

Fixed in v0.1.7.3.