`unshelve --preview` fails with unicode error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Andrej A Antonov |
Bug Description
Preview of unshelving file with non-ascii characters in it failed with traceback:
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\diff.pyo", line 444, in show_diff_trees
File "bzrlib\diff.pyo", line 889, in show_diff
File "bzrlib\diff.pyo", line 949, in _show_diff
File "bzrlib\diff.pyo", line 975, in _diff
File "bzrlib\diff.pyo", line 506, in _diff_many
File "bzrlib\diff.pyo", line 644, in diff
File "bzrlib\diff.pyo", line 667, in diff_text
File "bzrlib\diff.pyo", line 113, in internal_diff
File "bzrlib\
File "codecs.pyo", line 303, in write
File "encodings\
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc8 in position 3: ordinal not in range(128)
bzr 2.1.0rc1 on python 2.5.4 (Windows-
arguments: ['C:\\Program Files\\
encoding: 'cp1251', fsenc: 'mbcs', lang: None
plugins:
acad C:\work\
bzrtools C:\Program Files\Bazaar\
colo C:\work\
explorer C:\work\
fastimport C:\work\
format1 C:\work\
launchpad C:\Program Files\Bazaar\
qbzr C:\work\
rebase C:\Program Files\Bazaar\
scmproj C:\work\
x_bit C:\work\
*** Bazaar has encountered an internal error. This probably indicates a
bug in Bazaar. You can help us fix it by filing a bug report at
https:/
including this traceback and a description of the problem.
I'm suspect the problem here is the same as with log -p: unshelve using wrong encoding mode for self.outf. The same approach should be applied here: to print the diff raw stdout stream should be used.
Related branches
- Martin Packman (community): Approve
-
Diff: 56 lines (+23/-1)3 files modifiedNEWS (+3/-0)
bzrlib/shelf_ui.py (+1/-1)
bzrlib/tests/blackbox/test_shelve.py (+19/-0)
tags: | added: shelf unicode |
Changed in bzr: | |
status: | Confirmed → In Progress |
Changed in bzr: | |
status: | In Progress → Fix Released |
assignee: | nobody → Andrej A Antonov (polymorphm) |
milestone: | none → 2.3b2 |
I'd say that in our new approach, it should be asking for a binary-mode make_output_ stream( ).