GNOME Bugzilla – Bug 627940
char newline '\x0d' leads to inaccurate highlights file differences
Last modified: 2011-01-21 22:21:38 UTC
Created attachment 168728 [details] example of 2 files with '\x0d' chars in meld Steps to reproduce the bug : ---------------------------- Comparing two files having '\x0d' new line characters. Meld Behavior : --------------- Meld does break the line, but the highlights doesn't take it into account. This leads to inaccurate highlights for that section and an offset in the highlights for the remaining parts of the files. How often does this happen : ---------------------------- 100% reproducible. Expected behavior : ------------------- On of the following : a) both line break and highlights don't take into account the '\x0d' characters b) both line break and highlights do take into account the '\x0d' characters Screenshot attached. Thanks. SB
Problematic on : ---------------- OS : Ubuntu linux 10.04 (32b) Python : Python 2.6.5 Does work on : -------------- OS : Ubuntu linux 8.04 (32b) Python : Python 2.5.2
Could you please attach the files in question? It would be useful to have a test case. Also, what version of Meld are you using? This looks like it's related to some Ubuntu bug with Python's universal newline support - this has cropped up in another situation as well. However, we should try to deal with the case anyway.
Created attachment 169033 [details] 1st file to meld
Created attachment 169034 [details] 2nd file to meld
Thanks for your interest! Meld versions are : Ubuntu 10.04 -> meld 1.3.0 Ubuntu 8.04 -> meld 1.1.5.1
Right, so this does seem to be an Ubuntu bug. Somehow, Python's universal newline handling is broken in Ubuntu, and since Meld relies upon it for reading non-\n files, you're seeing this bug. The only way we'd work around this is to provide our own version of universal newline support. This might happen in a unicode rework, but it's a fairly significant change otherwise.
Ok. That problem has been reported to Ubuntu as well : https://bugs.launchpad.net/ubuntu/+source/meld/+bug/578121 I guess the best correction to be done then is on ubuntu's python implementation of new line.
Created attachment 173288 [details] [review] Patch for testing This patch is actually to deal with bug 602933, but should fix this as well. Could you please test this patch and see whether it fixes the bug? It does for me, but in order to see the bug in the first place, I have to contort my setup, so it would be nice to see whether it does for you as well.
I was not so comfortable with git and patch, but I've done it yet. Yes! The code out from git, patched worked perfectly for me. Thank you, How are things happening now?
I've pushed the above patch to git HEAD, so closing this bug. Thanks for the bug report and for the testing.
*** Bug 640199 has been marked as a duplicate of this bug. ***