[issue24780] difflib.ndiff produces unreadable output when input missing trailing newline

2019-01-08 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

When I first created the issue, the title I chose was about unittest ("unittest 
assertEqual difference output foiled by newlines"), but someone else changed it 
for some reason. You're welcome to change it back to something more like the 
original.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24780] difflib.ndiff produces unreadable output when input missing trailing newline

2019-01-08 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Looking at the patch and the relevant function this doesn't seem to be a 
problem with difflib.ndiff but with unittest's display algorithm. This causes 
confusion about the issue and I propose changing the subject to reflect this 
unless difflib maintainers think this is an issue with ndiff.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24780] difflib.ndiff produces unreadable output when input missing trailing newline

2019-01-08 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak
versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24780] difflib.ndiff produces unreadable output when input missing trailing newline

2016-09-17 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +loewis, tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24780] difflib.ndiff produces unreadable output when input missing trailing newline

2016-09-15 Thread Adrian Chan

Adrian Chan added the comment:

I've attached a potential fix for this issue.

While trying to fix this, I noticed that I coudn't assume that I just need to 
ensure that each line has a newline. If I always ensure each line in diffline 
has a newline, then the fourth test in testAssertMultilineEqual (in 
Lib/unittest/test/test_assertions.py) fails because standardMsg in 
assertMultiLineEqual in Lib/unittest/case.py is just one line without a 
newline. To sidestep this problem, I made it so that I only ensure there is a 
newline for each line if and only if there is more than one line in difflines. 
However, I'm not sure that I can assume there should be a newline in cases 
similar to the fourth test (where longMessage is set to true and a 'msg' is 
passed) in testAssertMultilineEqual but where there is more than one line in 
standardMsg in assertMultiLineEqual.

--
Added file: http://bugs.python.org/file44679/fix_24780.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24780] difflib.ndiff produces unreadable output when input missing trailing newline

2016-09-15 Thread ppperry

Changes by ppperry :


--
components:  -Tests
title: unittest assertEqual difference output foiled by newlines -> 
difflib.ndiff produces unreadable output when input missing trailing newline

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com