UnicodeDecodeError with non-ASCII character in filename

Bug #187267 reported by Torsten Bronger
18
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned

Bug Description

1. Under Windows XP, create a directory with a file with a filename with a non-ASCII character in it.

2. In this directory, enter "bzr init".

3. Then, add this directory (or one of its parents) as a Samba drive under Linux with charset=iso8859-1 (which is wrong, it should be utf8, but there we go). The main encoding on the Linux system must be UTF8 (almost always the case nowadays).

4. Enter the directory and say "bzr stat"

5. You get a traceback with "UnicodeDecodeError".

It is correct that Bazaar encounters an error since the encoding of the filename is invalid utf-8 but it should exit gently rather than giving a traceback.

Revision history for this message
Torsten Bronger (bronger) wrote :
Revision history for this message
Torsten Bronger (bronger) wrote :

Sorry, mixed up to bugs. Back zu Bazaar (without -svn).

Revision history for this message
Erik Bosman (ebosman) wrote :

I got the same error. It doesn't have to involve badly configured
charsets anywhere, just a bad filename.

Reproduction is very simple.

~$ mkdir bugtest
~$ cd bugtest/
~/bugtest$ bzr init
~/bugtest$ touch `printf "\x83"`
~/bugtest$ bzr status

Revision history for this message
codeslinger (codeslinger) wrote :

this is probably a dup of Bug #135320

but this repro from Erik is great! the devs have been looking for a simple case like that.

James Westby (james-w)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Mert Dirik (mertdirik) wrote :

@codeslinger:
Since #135320 has been fixed and this bug is still there, it shouldn't be a dup of #135320.

Revision history for this message
Mert Dirik (mertdirik) wrote :

@codeslinger:
Sorry I didn't notice that status complains that there is a bad file name and exits; but bzr add still throws an exception.

Revision history for this message
Serkan Kaba (serkan-kaba) wrote :

I reproduced this error on Gentoo with bzr revert.

Here's my bzr --version output

Bazaar (bzr) 1.11
  Python interpreter: /usr/bin/python 2.5.2
  Python standard library: /usr/lib64/python2.5
  bzrlib: /usr/lib64/python2.5/site-packages/bzrlib
  Bazaar configuration: /home/firari/.bazaar
  Bazaar log file: /home/firari/.bzr.log

Copyright 2005, 2006, 2007, 2008, 2009 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

I'm attaching bzr.log file when I reproduced the issue.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

gwenhwyvar:~/tmp% bzr init t
Created a standalone tree (format: 2a)
gwenhwyvar:~/tmp% cd t
gwenhwyvar:~/tmp/t% touch `printf "\x83"`
gwenhwyvar:~/tmp/t% bzr st
bzr: ERROR: Filename '\x83' is not valid in your current filesystem encoding UTF-8

Changed in bzr:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.