davidfoerster/aptsources-cleanup

Syntax Error with 0.1.6, 0.1.5 works after install additional packages

Closed this issue · 2 comments

Ubuntu 18.10
python3-apt installed

# python -0Es aptsources-cleanup
error
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/....../aptsources-cleanup.zip/__main__.py", line 8, in <module>
  File "/usr/lib/python2.7/runpy.py", line 182, in run_module
    mod_name, loader, code, fname = _get_module_details(mod_name)
  File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
    __import__(mod_name)  # Do not catch exceptions initializing package
  File "/......./aptsources-cleanup.zip/aptsources_cleanup/__init__.py", line 17, in <module>
  File "/......./aptsources-cleanup.zip/aptsources_cleanup/util/filesystem.py", line 38
    termwrap.stderr().print('{:s}: {!s}'.format(_('Error'), ex))
                           ^
SyntaxError: invalid syntax

Running v0.1.5 requested installing python-apt package, after which, it ran as expected.

Thanks for the script!

Python 2 is unsupported as of version 0.1.6. Please use Python 3. Also that 0 (zero) is supposed to be an O (capital letter O):

python3 -OEs aptsources-cleanup

Thanks, I didn't realize "python" defaulted to v2.