classification
Title: difflib.HtmlDiff().make_file() treat few change as whole line change
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Fairuz Zack, SilentGhost, jlwing
Priority: normal Keywords:

Created on 2016-05-04 10:18 by Fairuz Zack, last changed 2016-08-08 15:21 by SilentGhost. This issue is now closed.

Files
File name Uploaded Description Edit
bug_report.txt Fairuz Zack, 2016-05-04 10:18
screenshot1.jpg jlwing, 2016-08-05 16:24 screenshot1
C.7z jlwing, 2016-08-08 09:51 reproducer py and test data
Messages (6)
msg264801 - (view) Author: Fairuz Zack (Fairuz Zack) * Date: 2016-05-04 10:18
html diff threat 2.011 as whole line added instead of only "11" is changed. example file i want to diff is under bug_report.txt. seems the diff not reasonable for other line in the txt as well.
msg264842 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-05-04 17:09
This seems to do with the percentage of affected characters, the threshold seems to be about a quarter. Not sure this is a bug.
msg272041 - (view) Author: JW (jlwing) Date: 2016-08-05 16:24
i found that making a change similar to this one in a certain place towards then end of my 300 or so long list of strings produces issues further along:

making a change of Latitude=1.1 -> Latitude=111.1 correctly shows as 11 added; however subsequent matching lines then incorrectly show as different (please see screenshot1)
msg272043 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-08-05 17:03
JW, could you submit a minimal reproducer for this?
msg272155 - (view) Author: JW (jlwing) Date: 2016-08-08 09:51
please find attached the reproducer C.7z

this issue only happens with this format of data before and after the difference
msg272172 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-08-08 15:21
JW, this doens't seem anything to do with the original issue. I'm going to close this issue and open a new one that's dealing with your case, I have a fix for it.
History
Date User Action Args
2016-08-08 15:21:23SilentGhostsetstatus: open -> closed
resolution: not a bug
messages: + msg272172

stage: resolved
2016-08-08 09:51:16jlwingsetfiles: + C.7z

messages: + msg272155
2016-08-05 17:03:43SilentGhostsetmessages: + msg272043
2016-08-05 16:24:11jlwingsetfiles: + screenshot1.jpg
nosy: + jlwing
messages: + msg272041

2016-05-04 17:09:15SilentGhostsetnosy: + SilentGhost
messages: + msg264842
2016-05-04 10:18:37Fairuz Zackcreate