Page MenuHomePhabricator

global: use raw strings for regular expressions with escapes

Authored by indygreg on Feb 4 2019, 12:18 PM.



Escape sequences like \w, \s, and \d are technically invalid
in str/bytes. This became a deprecation warning in Python 3.6
( Python 3.8 bumps it to
a SyntaxWarning (, which is
non-silent by default.

This commit changes a number of regular expressions to use
br'' so regular expression special sequences don't need \\
literals. This fixes roughly half of the SyntaxWarning we
see in the code base with Python 3.8.

Diff Detail

rHG Mercurial
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Feb 4 2019, 12:18 PM
This revision was automatically updated to reflect the committed changes.