The flags option to re.sub is only in Python 2.7 and later

Instead use '(?u)' in the regular expression.
Merge branch 'master' into staging-auto-deployed