UnicodeDecodeError in fast-export when author name contains non-ascii characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-fastimport (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Zesty |
Won't Fix
|
High
|
Mattia Rizzolo | ||
Artful |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
* dealing with objects with a non-ascii char in their name just fail
[ Test case ]
* just try to export a bzr branch with a non-char character, for example the ubuntu-dev-tools bzr repository.
[ Regression potential ]
* The change has been in stretch and artful for a while, with no regressions reported
* also the change itself is kind of small and easily auditable
[ Original description ]
I was able to decipher that it failed when it got to the part of history where the commit author's name was "Raúl Núñez". (git-bzr is http://
$ git bzr clone lp:sakura
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
Branched 562 revisions.tching revisions:Finishing stream:Estimate 6041/7652
14:42:10 Calculating the revisions to include ...
14:42:10 Starting export of 743 revisions ...
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 "/usr/lib/
return exporter.run()
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
return self.__bytes__()
File "/usr/lib/
return self.to_
File "/usr/lib/
author_section = b'\nauthor ' + format_
File "/usr/lib/
name = utf8_bytes_
File "/usr/lib/
return s.encode('utf8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128)
bzr 2.7.0 on python 2.7.12 (Linux-
arguments: ['/usr/sbin/bzr', 'fast-export', '--plain', '--export-
marks=
branch=
'/home/
plugins: bash_completion
fastimport[
netrc_
weave_
encoding: 'utf-8', fsenc: 'UTF-8', lang: 'en_CA.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.
ERROR:root:bzr export failed
I fixed it by changing `s.encode('utf8')` to `return unicode(s, 'utf8')
affects: | bzr → bzr-fastimport |
affects: | bzr-fastimport → python-fastimport |
affects: | python-fastimport → bzr-fastimport |
affects: | python-fastimport (Ubuntu) → bzr-fastimport (Ubuntu) |
affects: | bzr-fastimport → python-fastimport |
affects: | bzr-fastimport (Ubuntu) → python-fastimport (Ubuntu) |
Changed in python-fastimport: | |
assignee: | nobody → Jelmer Vernooij (jelmer) |
importance: | Undecided → Medium |
status: | New → Fix Committed |
no longer affects: | python-fastimport |
Status changed to 'Confirmed' because the bug affects multiple users.