power-usage-report: misplaced flags in re.sub()

Bug #1683164 reported by Jakub Wilk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fatrace
Fix Released
Undecided
Unassigned

Bug Description

power-usage-report contains the following line:

    lines = re.sub('\n{3,}', '\n\n', raw_out, re.S).splitlines()

But the 4th re.sub() argument is maximum number of substitutions, not flags.
Also, the regexp doesn't have any "." metacharacters, so the re.S flag
wouldn't have any effect. I guess it should be removed.

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

Revision history for this message
Martin Pitt (pitti) wrote :

Indeed, thank you! Fixed in master.

Changed in fatrace:
status: New → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in fatrace:
status: Fix Committed → Fix Released
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.