Merge lp://staging/~hid-iwata/bzr/fix-mojibake into lp://staging/bzr

Proposed by IWATA Hidetaka
Status: Needs review
Proposed branch: lp://staging/~hid-iwata/bzr/fix-mojibake
Merge into: lp://staging/bzr
Diff against target: 68 lines (+31/-2)
2 files modified
bzrlib/commands.py (+9/-2)
bzrlib/trace.py (+22/-0)
To merge this branch: bzr merge lp://staging/~hid-iwata/bzr/fix-mojibake
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+119051@code.staging.launchpad.net

Description of the change

Workaround for #777996 and #909152

Unreadable error message can be a huge blocker for newbie users.
This patch may not be perfect, but I think this is better than now.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

This is close to the right fix for this (longstanding and very annoying) issue.

I really think we want to do the decoding inside trace.report_exception rather than wrapping the stream passed to allow it to be stupid, what do you think?

Revision history for this message
IWATA Hidetaka (hid-iwata) wrote :

All stderr output must be encoded to terminal-encoding, even if stderr.encoding is None. (qbzr requires such behavior)
inside trace.report_exception, err_file can be any other file-like-object and I don't know which encoding to choose.
This is the reason why I use wrapped stream.

Unmerged revisions

6545. By IWATA Hidetaka

Consider decoding error.

6544. By IWATA Hidetaka

Fix mojibake of localized error message.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.