New submission from Mahmoud Al-Qudsi: While using the icdiff command line interface to difflib, I ran into an interesting issue where difflib took 47 seconds to compare two simple text documents (a PHP source code file that had been refactored via phptidy).
On subsequent analysis, it turned out to be some sort of pathological behavior triggered by the presence of mixed line endings. Normalizing the line endings in both files to \r\n via unix2dos and then comparing (making no other changes) resulted in the diff calculation completing in under 2 seconds. I have attached the documents in question (file1 and file2) to this bug report. ---------- components: Library (Lib) files: file1 messages: 302788 nosy: Mahmoud Al-Qudsi priority: normal severity: normal status: open title: difflib pathological behavior with mixed line endings versions: Python 3.6 Added file: https://bugs.python.org/file47164/file1 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31561> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com