yodalee / mozc

Mozc - a Japanese Input Method Editor designed for multi-platform
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

re.sub() with misplaced flags #98

Open yodalee opened 6 years ago

yodalee commented 6 years ago

src/dictionary/gen_zip_code_seed.py contains the following code:

  level3 = re.sub(u'(.*)', u'', level3, re.U)

But the 4th argument to re.sub() is supposed to be maximum number of substitutions, not flags.

NB, the re.U flag affects only semantics of \w, \W, \b, \B, \d, \D, \s and \S, so it wouldn't have any effect on this regular expression.

This bug was found using pydiatra.