UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 584: ordinal not in range(128) at line 221 : "return result + rest"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar Keywords Plugin |
New
|
Undecided
|
Unassigned |
Bug Description
Using the bzr-keywords plugin, I (systematicaly) got the following call stack :
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/usr/lib/
return the_callable(*args, **kwargs)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
return self._operation
File "/usr/lib/
self.cleanups, self.func, *args, **kwargs)
File "/usr/lib/
result = func(*args, **kwargs)
File "/home/
return super(cmd_export, self).run(*args, **kwargs)
File "/usr/lib/
per_
File "/usr/lib/
per_
File "/usr/lib/
force_
File "/usr/lib/
chunks = filtered_
File "/usr/lib/
chunks = filter.
File "/home/
return _kw_expander(
File "/home/
encoder=
File "/home/
return result + rest
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 584: ordinal not in range(128)
bzr 2.4.2 on python 2.6.6 (Linux-
Ubuntu-
arguments: ['/usr/bin/bzr', 'export', '/home/
L_WORKSHOP/
keywords=
plugins: avahi[0.3.0dev], bash_completion
bzr_
dbus[0.1.0dev], diff_revid[
extmerge[
launchpad[
netrc_
qbzr[0.21.1], rewrite[0.6.2], shell_completer
stats[0.1.0], upload[1.0.1dev], vimdiff[unknown], weave_fmt[2.4.2],
xmloutput[
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'fr_FR.UTF-8'
*** 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.
make: *** [export] Erreur 4
I have a quick fix for this issue... I noticed that the type of 'result' variable is 'unicode' ($PYTHON > type(result)) and the type of 'rest' is 'str' ($PYTHON > type(str)). Python was not able to transtype the 'result + rest' operation.
So the fix consist to replace : 'result + rest' by 'str(result) + str(rest)'
Thanks for the report, converting the unicode part to a byte string sounds like the right idea, but unfortunately just using str() is probably not enough, some kind of encoding probably needs to happen. Follow up in the existing bug if you have more thoughts.