adding iso-8859-1 paths on a UTF8 file system gives a harsh error message
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
New
|
Undecided
|
Unassigned |
Bug Description
Playing around with bzr to version stuff from the debian archive we
found a nasty traceback:
File "/home/
line 384, in run
no_recurse, action=action, save=not dry_run)
File "/home/
line 51, in tree_write_locked
return unbound(self, *args, **kwargs)
File "/home/
line 400, in smart_add
for subf in sorted(
UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 0:
ordinal not in range(128)
What is happening here is:
(Pdb) abspath
u'/home/
(Pdb) os.listdir(abspath)
['\xedslenska.
(Pdb) sorted(
*** UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position
0: ordinal not in range(128)
That is: the path that is in iso8859-1 encoding on disk is not upcast to
unicode by os.listdir (as it fails to decode with utf8), so sorted()
when it compares the two strings tries to upcast it to unicode again,
which fails, and we get this lovely exception.
We should handle this more cleanly in some manner. (Preferably telling
the user they have a non-$filesystem
can correct it and run again).
-Rob
affects bzr
--
GPG key available at: <http://
Hi,
This appears to be a duplicate of bug 77657, so I have marked it as such.
Thanks,
James