Comment 8 for bug 1644003

Revision history for this message
Vincent Ladeuil (vila) wrote : Re: breaks with python 2.7.12-7

More info:

https://bugs.python.org/issue28563 fix https://hg.python.org/cpython/rev/e0cc3fadd7b3 is indeed what creates the issue.

$ ./bzr selftest test_i18n.TestInstall

catches the issue

=== modified file 'bzrlib/lazy_regex.py'
*** bzrlib/lazy_regex.py 2011-12-19 13:23:58 +0000
--- bzrlib/lazy_regex.py 2016-11-26 12:57:20 +0000
***************
*** 131,133 ****
--- 131,141 ----
      raise AssertionError(
          "re.compile has already been overridden as lazy_compile, but this wou\
ld" \
          " cause infinite recursion")
+ # re.finditer get confused if it receives a LazyRegex
+ if getattr(re, 'finditer', None is not None):
+ def finditer_public(pattern, string, flags=0):
+ if isinstance(pattern, LazyRegex):
+ return pattern.finditer(string)
+ else:
+ return _real_re_compile(pattern, flags).finditer(string)
+ re.finditer = finditer_public

makes the test pass again.

I'll prepare a branch asap.