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

Assertion fails when using the built-in "re" module #30

Closed lggwettmann closed 4 years ago

lggwettmann commented 4 years ago

I get this:

  File "aptsources-cleanup.pyz/aptsources_cleanup/util/gettext.py", line 213, in ChoiceHighlighters
    builtins.__dict__['_'] = self.gettext
AssertionError: "unprintable_delimiters" contains regex meta-characters.
davidfoerster commented 4 years ago

Ugh, looks like re.escape (before Python 3.9) escapes all non-ASCII characters. I’ll release a fix/work-around some time soon.

In the mean time you can skip assertion checks if you invoke Python with the -O flag. I also rebuilt the PYZ bundle for the current release to include a shebang line, so you can actually execute it as described in Usage which also skips assertion checks.

davidfoerster commented 4 years ago

Fixed in aac69ce02ede727327645862af7d09ce86d77b23