[issue21253] Difflib.compare() crashes on mostly different sequences

Gregory P. Smith report at bugs.python.org
Sat Apr 19 01:52:20 CEST 2014


Gregory P. Smith added the comment:

It appears to devolve into linear recursion in this case, one per each item in one of the sequences being searched for a match, so even using a stack seems wrong as it'd still be linear (though it would prevent the recursion depth problem).

The mutual _fancy_replace + _fancy_helper linear recursion comes from http://hg.python.org/cpython/file/604b74f9a07d/Lib/difflib.py#l1021

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21253>
_______________________________________


More information about the Python-bugs-list mailing list