After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726116 - UnicodeDecodeError traceback prevents file diff from occurring
UnicodeDecodeError traceback prevents file diff from occurring
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: filediff
3.11.x
Other Linux
: Normal major
: ---
Assigned To: meld-maint
meld-maint
: 730660 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-03-11 15:50 UTC by Jean-François Fortin Tam
Modified: 2014-05-23 20:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (49.35 KB, image/png)
2014-03-11 15:50 UTC, Jean-François Fortin Tam
Details

Description Jean-François Fortin Tam 2014-03-11 15:50:38 UTC
Created attachment 271532 [details]
screenshot

$ meld .

# The ui in the attached screenshot appears.
# When double-clicking "mainwindow.py" to see the uncommitted changes diff:

Traceback (most recent call last):
  • File "/usr/lib/python2.7/site-packages/meld/meldwindow.py", line 575 in <lambda>
    self.append_diff(arg, **kwargs))
  • File "/usr/lib/python2.7/site-packages/meld/meldwindow.py", line 632 in append_diff
    return self.append_filediff(paths, merge_output=merge_output)
  • File "/usr/lib/python2.7/site-packages/meld/meldwindow.py", line 604 in append_filediff
    doc = filediff.FileDiff(len(files))
  • File "/usr/lib/python2.7/site-packages/meld/filediff.py", line 321 in __init__
    self.set_num_panes(num_panes)
  • File "/usr/lib/python2.7/site-packages/meld/filediff.py", line 1889 in set_num_panes
    self.recompute_label()
  • File "/usr/lib/python2.7/site-packages/meld/filediff.py", line 1061 in recompute_label
    self.label_text = (" — ").decode('utf8').join(shortnames)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)

Comment 1 Kai Willadsen 2014-03-11 21:36:56 UTC
What's really exciting here is that I don't know how we haven't seen this problem before. We are acting like gettext should be giving us unicode, but we've carelessly sabotaged that.

One option is to remove all of our gettext imports from modules; we install _() as ugettext in the namespace. Another option is to merge my current Python 3 branch, which appears to (and should) fix this. I'll take a better look at options on the weekend.

Unfortunately, I can't find a quick workaround for this, other than to use a language that doesn't have non-ascii in the relevant messages (so far just the "<unnamed>" string, though there may be others). Not a real solution obviously.
Comment 2 Kai Willadsen 2014-03-15 02:10:02 UTC
This is now fixed in HEAD, and the fix should survive the Python 3 transition as well. Thanks for the bug report.
Comment 3 Kai Willadsen 2014-05-23 20:44:42 UTC
*** Bug 730660 has been marked as a duplicate of this bug. ***