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.
More info:
https:/ /bugs.python. org/issue28563 fix https:/ /hg.python. org/cpython/ rev/e0cc3fadd7b 3 is indeed what creates the issue.
$ ./bzr selftest test_i18n. TestInstall
catches the issue
=== modified file 'bzrlib/ lazy_regex. py' lazy_regex. py 2011-12-19 13:23:58 +0000 lazy_regex. py 2016-11-26 12:57:20 +0000
"re. compile has already been overridden as lazy_compile, but this wou\ public( pattern, string, flags=0): finditer( string) compile( pattern, flags). finditer( string)
*** bzrlib/
--- bzrlib/
***************
*** 131,133 ****
--- 131,141 ----
raise AssertionError(
ld" \
" cause infinite recursion")
+ # re.finditer get confused if it receives a LazyRegex
+ if getattr(re, 'finditer', None is not None):
+ def finditer_
+ if isinstance(pattern, LazyRegex):
+ return pattern.
+ else:
+ return _real_re_
+ re.finditer = finditer_public
makes the test pass again.
I'll prepare a branch asap.