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.

Title: {context,unified}_diff add spurious trailing whitespace if fromfiledate/tofiledate are emptyk
Type: behavior Stage: resolved
Components: Library (Lib) Versions:
Status: closed Resolution: fixed
Dependencies: Superseder: difflib should separate filename from timestamp with tab
View: 7585
Assigned To: Nosy List: dato, jameinel, loewis, techtonik
Priority: normal Keywords: patch

Created on 2009-01-09 15:38 by dato, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
python_difflib_fix.diff dato, 2009-01-09 15:38 Patch to fix this issue
Messages (5)
msg79473 - (view) Author: Adeodato Simó (dato) Date: 2009-01-09 15:38

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 


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.)

msg79493 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-09 19:48
Who is the author of this patch?
msg79494 - (view) Author: Adeodato Simó (dato) Date: 2009-01-09 19:51
> Who is the author of this patch?

I am the author of the patch attached to this bug report.
msg105640 - (view) Author: anatoly techtonik (techtonik) Date: 2010-05-13 16:20
Another 'easy' patch hangs for ages. =/

msg105643 - (view) Author: anatoly techtonik (techtonik) Date: 2010-05-13 16:27
Thanks for the patch. This was fixed as part of issue 7585.

Please add issue 7585 as superceder and close this.
Date User Action Args
2022-04-11 14:56:43adminsetgithub: 49148
2010-05-14 04:59:29r.david.murraysetstatus: open -> closed
resolution: fixed
superseder: difflib should separate filename from timestamp with tab
stage: resolved
2010-05-13 16:27:09techtoniksetmessages: + msg105643
2010-05-13 16:20:18techtoniksetnosy: + techtonik
messages: + msg105640
2009-01-09 19:51:50datosetmessages: + msg79494
2009-01-09 19:48:04loewissetnosy: + loewis
messages: + msg79493
2009-01-09 15:38:11datocreate