show_diff_trees writes Unicode if there are Binary files

Bug #110092 reported by John A Meinel
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Fix Released
Medium
Jelmer Vernooij

Bug Description

Currently 'show_diff_trees' is supposed to be defined as writing 8-bit strings to the output file.
For filenames, it always writes utf-8 strings. And for file contents it writes the raw 8-bit content.

However the code path for handling Binary files, just writes the unicode filenames directly to the file.

It should instead encode to utf8 first.

Tags: diff
Revision history for this message
John A Meinel (jameinel) wrote :

The fix may be as simple as:
=== modified file 'bzrlib/inventory.py'
--- bzrlib/inventory.py 2007-04-04 02:31:25 +0000
+++ bzrlib/inventory.py 2007-04-25 21:15:37 +0000
@@ -665,7 +665,7 @@
                 label_pair = (to_label, from_label)
             else:
                 label_pair = (from_label, to_label)
- print >> output_to, "Binary files %s and %s differ" % label_pair
+ print >> output_to, ("Binary files %s and %s differ" % label_pair).encode('utf8')

     def has_text(self):
         """See InventoryEntry.has_text."""

John A Meinel (jameinel)
Changed in bzr:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Jonathan Lange (jml) wrote :

I'm working on this.

Changed in bzr:
assignee: nobody → jml
status: Confirmed → In Progress
Revision history for this message
Jonathan Lange (jml) wrote :

No I'm not.

Changed in bzr:
assignee: Jonathan Lange (jml) → nobody
Jelmer Vernooij (jelmer)
Changed in bzr:
status: In Progress → Confirmed
tags: added: diff
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
Changed in brz:
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → Jelmer Vernooij (jelmer)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.