You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
{context,unified}_diff add spurious trailing whitespace if fromfiledate/tofiledate are emptyk #49148
I recently noticed that Bazaar's unified_diff() was emiting ---/+++
lines with a trailing whitespace if fromfiledate/tofiledate were the
empty string. (Which was bad because a program to detect spurious
trailing whitespace in diffs would flag them as errors.)
A patch 1 was committed recently in their tree. During the
discussion, it was pointed out that the affected function was a copy
of Python's own unified_diff() in difflib, which suffered the same
problem.
I'm now attaching a patch to fix this issue in Python. It'd be great
if you'd consider applying it. (It seems that the correct character to
separate dates is a tab and not a space; if you feel changing this is
breaking backwards compatibility, feel free to s/\t/ / in my patch.)
Activity
dato commentedon Jan 9, 2009
Hello.
I recently noticed that Bazaar's unified_diff() was emiting ---/+++
lines with a trailing whitespace if fromfiledate/tofiledate were the
empty string. (Which was bad because a program to detect spurious
trailing whitespace in diffs would flag them as errors.)
A patch 1 was committed recently in their tree. During the
discussion, it was pointed out that the affected function was a copy
of Python's own unified_diff() in difflib, which suffered the same
problem.
I'm now attaching a patch to fix this issue in Python. It'd be great
if you'd consider applying it. (It seems that the correct character to
separate dates is a tab and not a space; if you feel changing this is
breaking backwards compatibility, feel free to s/\t/ / in my patch.)
Thanks.
loewis commentedon Jan 9, 2009
Who is the author of this patch?
dato commentedon Jan 9, 2009
I am the author of the patch attached to this bug report.
techtonik commentedon May 13, 2010
Another 'easy' patch hangs for ages. =/
tag:easy
tag:difflib
techtonik commentedon May 13, 2010
Thanks for the patch. This was fixed as part of bpo-7585.
Please add bpo-7585 as superceder and close this.