[issue4622] SequenceMatcher bug with long sequences
New submission from eliben <[EMAIL PROTECTED]>: Here's a reproduction of the error: Python 2.5.2 (r252:60911, Oct 20 2008, 09:11:31) [GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import difflib >>> >>> difflib.SequenceMatcher(None, [4] + [5] * 200, [5] * 200).ratio() 0.0 ratio() should be returning close to 1.0 here, not 0. This is only a problem for sequences longer than 200. The analogous run for 100: >>> difflib.SequenceMatcher(None, [4] + [5] * 100, [5] * 100).ratio() 0.99502487562189057 >>> I've managed to reproduce it on Linux, Windows (AS 2.5.2) and Try Python (http://try-python.mired.org/) -- components: Library (Lib) messages: 77559 nosy: eliben severity: normal status: open title: SequenceMatcher bug with long sequences versions: Python 2.5 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4622> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5117] os.path.relpath problem with root drive directory on windows
New submission from eliben : This is correct: relpath(r'd:\abc\jho', r'd:\abc') => 'jho' But this isn't: relpath(r'd:\jho', r'd:\\') => '..\jho' Neither is this: relpath(r'd:\jho', r'd:') => '..\..\..\jho' -- components: Library (Lib) messages: 80860 nosy: eliben severity: normal status: open title: os.path.relpath problem with root drive directory on windows type: behavior versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue5117> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5117] os.path.relpath problem with root drive directory on windows
eliben added the comment: The problem is with these lines: start_list = abspath(start).split(sep) path_list = abspath(path).split(sep) In case of 'd:\', the split returns two elements, the second empty. ___ Python tracker <http://bugs.python.org/issue5117> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com