The difflib.Differ() object doesn't always add a hint for added tab characters. eg: import difflib differ = difflib.Differ() for change in differ.compare(["\tI am a buggy"], ["\t\tI am a bug"]): print repr(change) Should return '- \tI am a buggy' '? \t --\n' '+ \t\tI am a bug' '? +\n' but actually returns (no hint for the added tab) '- \tI am a buggy' '? \t --\n' '+ \t\tI am a bug' sys.version reports 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
Logged In: YES user_id=1083163 Fix attached. Note that this also modifies the doctest for Differ._qformat, as the doctest version actually exhibited the bug (the added tab character wasn't hinted).
Please apply the patch ASAP. This bug is affecting downstream product viewvc in a very adverse way. See http://viewvc.tigris.org/issues/show_bug.cgi?id=436 It's sad that I spent several hours tracking down this bug only to find out that henryl found it and provided a fix *3 and a half years ago*. Why is it taking so long to apply such a small yet important patch?
Yes, I noticed the issue and found the patch to be good as well. Unfortunate it was pending for a long time. Fixed and Committed revision 76464 (trunk).