Handling of names in UTF-8 (Unicode)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar Fast Import |
Fix Released
|
Medium
|
Daniel Clemente |
Bug Description
bzr fast-import fails while importing a repository where there are symbolic links pointing to non-ASCII names.
* How to reproduce it:
First make sure that your locale is UTF-8. Following command should display 2: echo -n é | wc -c
Then do:
mkdir tres
cd tres
git init
touch més
ln -s més prova
git add més prova
git commit -a -m "link to a file with a name in utf-8"
git-fast-export --all >expo
mkdir enbzr
cd enbzr
bzr init
bzr fast-import ../expo
* The result:
Traceback (most recent call last):
File "/usr/lib/
return run_bzr(argv)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/home/
File "/home/
File "/home/
self.
File "/home/
processor.
File "/home/
handler(self, cmd)
File "/home/
handler.
File "/home/
handler(self, fc)
File "/home/
filecmd.
File "/home/
ie.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
bzr 1.5 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'fast-import', '../expo']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'es_ES.UTF-8'
plugins:
bzrtools /usr/lib/
dbus /usr/lib/
fastimport /home/dc/
gtk /usr/lib/
launchpad /usr/lib/
... Bazaar has encountered an internal error.
Please report a bug at https:/
including this traceback, and a description of what you
were doing when the error occurred.
Tested with stable version of fastimport and also the one from fastimport.dev from today.
Related branches
- Jelmer Vernooij (community): Approve (code)
-
Diff: 45 lines (+7/-6)2 files modifiedbzr_commit_handler.py (+5/-5)
commands.py (+2/-1)
summary: |
- Symbolic links to files with names in UTF-8 (Unicode) + Handling of names in UTF-8 (Unicode) |
Changed in bzr-fastimport: | |
status: | Fix Committed → Fix Released |
milestone: | none → 0.10.0 |
This line:
ie.symlink_target = data.encode('utf8')
could be changed to:
ie.symlink_target = data
to prevent a failed conversion (¿from utf8 to utf8?) and to store the symlink really as it is. However, Bazaar doesn't support symlinks to Unicode (in fact, non-ASCII) filenames yet. This bug depends on bug 272444.