Tim Peters <t...@python.org> added the comment:

I believe your testing code is in error, perhaps because it's so overly 
elaborate you've lost track of what it's doing.  Here's a straightforward test 
program:

    import difflib
    s1='<a id="nhix_Rgstr" href="http://local:56067/register/200930162135700";>'
    s2='<a id="nhix_Rgstr" 
href="http://local:53813/register/20100517282450281";>'
    d = difflib.SequenceMatcher(None, s1, s2)
    for m in d.get_matching_blocks():
        print(m, repr(s1[m.a : m.a + m.size]),
                 repr(s2[m.b : m.b + m.size]))

and its output under 3.9.0:

    Match(a=0, b=0, size=39) '<a id="nhix_Rgstr" href="http://local:5' '<a 
id="nhix_Rgstr" href="http://local:5'
    Match(a=43, b=43, size=12) '/register/20' '/register/20'
    Match(a=59, b=55, size=1) '1' '1'
    Match(a=66, b=56, size=2) '00' '00'
    Match(a=68, b=70, size=2) '">' '">'
    Match(a=70, b=72, size=0) '' ''

Your test program is obtaining the substrings to display from these two lines:

        mtch_a = dpiy_Frst[mblk.a : mblk.a + mblk.size];
        mtch_b = dpiy_Frst[mblk.b : mblk.b + mblk.size];

But BOTH of those are extracting substrings from `dply_Frst`. Looks like you 
intended to use the `dply_Scnd` argument in the second line instead.

If I change my test program to use `s1` for both substrings, then it matches 
the output you gave. But that doesn't make sense ;-)

So I'm closing this as not-a-bug. If I missed something relevant, feel free to 
re-open it.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41964>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to