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

UnboundLocalError: local variable 'kwargs' referenced before assignment #19

Closed nvsneddon closed 5 years ago

nvsneddon commented 5 years ago

I get the following error when I attempt to run this.

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "aptsources-cleanup.zip/__main__.py", line 8, in <module>
  File "/usr/lib/python3.7/runpy.py", line 208, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "aptsources-cleanup.zip/aptsources_cleanup/__main__.py", line 353, in <module>
  File "aptsources-cleanup.zip/aptsources_cleanup/__main__.py", line 43, in main
  File "aptsources-cleanup.zip/aptsources_cleanup/__main__.py", line 283, in handle_duplicates
  File "aptsources-cleanup.zip/aptsources_cleanup/util/gettext.py", line 295, in __init__
    tmsg = msgid1
  File "aptsources-cleanup.zip/aptsources_cleanup/util/gettext.py", line 347, in _get_short_and_styled
    # bit words.
  File "aptsources-cleanup.zip/aptsources_cleanup/util/functools.py", line 37, in __call__
    def update_wrapper(wrapper,
UnboundLocalError: local variable 'kwargs' referenced before assignment
miguel9554 commented 5 years ago

I'm getting the same error, with this output

Overlapping source entries:
 1. file “/etc/apt/sources.list”:
    deb [arch=i386,amd64] https://deb.opera.com/opera-stable/ stable non-free
 2. file “/etc/apt/sources.list.d/opera-stable.list”:
    deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser
    (final releases)
I disabled the latter entry.

1 source entry was disabled:
  # deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser
    (final releases)

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "aptsources-cleanup.zip/__main__.py", line 8, in <module>
  File "/usr/lib/python3.7/runpy.py", line 208, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "aptsources-cleanup.zip/aptsources_cleanup/__main__.py", line 353, in <module>
  File "aptsources-cleanup.zip/aptsources_cleanup/__main__.py", line 43, in main
  File "aptsources-cleanup.zip/aptsources_cleanup/__main__.py", line 283, in handle_duplicates
  File "aptsources-cleanup.zip/aptsources_cleanup/util/gettext.py", line 295, in __init__
    tmsg = msgid1
  File "aptsources-cleanup.zip/aptsources_cleanup/util/gettext.py", line 347, in _get_short_and_styled
    # bit words.
  File "aptsources-cleanup.zip/aptsources_cleanup/util/functools.py", line 37, in __call__
    def update_wrapper(wrapper,
UnboundLocalError: local variable 'kwargs' referenced before assignment
davidfoerster commented 5 years ago

Sorry for those slip-ups. I'm on it. Thanks (again) for your reports!

davidfoerster commented 5 years ago

Fixed in df169bc8dead3d531d40449824e31601241cbe7b (v0.1.6.3).

nvsneddon commented 5 years ago

Thank you so much. This script is amazing.