This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients chris.jerdonek, jaraco, tim.peters, xtreak
Date 2019-02-11.18:32:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549909936.09.0.0460239885918.issue35955@roundup.psfhosted.org>
In-reply-to
Content
I am not sure this is a duplicate since the other issue was about newline at the end of strings. This is about the diff being little irrelevant even with newline in the end for strings. Sample program where change in 5th character gives the reported diff.

import difflib

for i in range(7):
    print(f"Change character at {i}")
    a = list("drwxrwxr-x 2 2000  2000\n")
    b = "drwxrwxr-x 2 2000  2000\n"
    a[i] = '-'
    a = ''.join(a)
    print(''.join(difflib.ndiff([a], [b])))

Change character at 0
- -rwxrwxr-x 2 2000  2000
? ^
+ drwxrwxr-x 2 2000  2000
? ^

Change character at 1
- d-wxrwxr-x 2 2000  2000
?  ^
+ drwxrwxr-x 2 2000  2000
?  ^

Change character at 2
- dr-xrwxr-x 2 2000  2000
?   ^
+ drwxrwxr-x 2 2000  2000
?   ^

Change character at 3
- drw-rwxr-x 2 2000  2000
?    ^
+ drwxrwxr-x 2 2000  2000
?    ^

Change character at 4
- drwx-wxr-x 2 2000  2000
?     ^
+ drwxrwxr-x 2 2000  2000
?     ^

Change character at 5
- drwxr-xr-x 2 2000  2000
?        ---
+ drwxrwxr-x 2 2000  2000
?  +++

Change character at 6
- drwxrw-r-x 2 2000  2000
?       ^
+ drwxrwxr-x 2 2000  2000
?       ^
History
Date User Action Args
2019-02-11 18:32:18xtreaksetrecipients: + xtreak, tim.peters, jaraco, chris.jerdonek
2019-02-11 18:32:16xtreaksetmessageid: <1549909936.09.0.0460239885918.issue35955@roundup.psfhosted.org>
2019-02-11 18:32:16xtreaklinkissue35955 messages
2019-02-11 18:32:15xtreakcreate