ui.py: bad regexp flag

Bug #1666244 reported by Jakub Wilk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AppArmor
New
Undecided
Unassigned

Bug Description

The get_translated_hotkey() function in utils/apparmor/ui.py contains
the following code:

    if re.search('\((\S+)\)', translated, re.LOCALE):
        return re.search('\((\S+)\)', translated, re.LOCALE).groups()[0]

Using re.LOCALE for Unicode regexps has never worked correctly.
This feature was deprecated in Python 3.5, and removed in Python 3.6.
If you run get_translated_hotkey() in Python 3.6, you get:

ValueError: cannot use LOCALE flag with a str pattern

This bug was found using pydiatra:
http://jwilk.net/software/pydiatra

Revision history for this message
Christian Boltz (cboltz) wrote :

We are already aware of this, see bug 1661766. I already sent a patch for review, so it should be fixed in bzr soon.

Nevertheless, thanks for the report!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.