branch command crashes with UnicodeEncodeError exception

Bug #299488 reported by davidedb
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

bzr 1.9 crashes when executing the command:

bzr branch http://gigo-ice.org/repos/extdiff

with the error message:

bzr: ERROR: exceptions.UnicodeEncodeError: 'ascii' codec can't encode characters in position 75-77: ordinal not in range(128)

See the attached log for more details.

For your convenience, here is the output of command 'bzr --version':

Bazaar (bzr) 1.9
  Python interpreter: /design/scripts/activestate/python/2.5.1.1/Linux.i686/bin/python 2.5.1
  Python standard library: /design/scripts/activestate/python/2.5.1.1/Linux.i686/lib/python2.5
  bzrlib: /design/scripts/canonical/bazaar/1.9/Linux.i686/lib/python2.5/site-packages/bzrlib
  Bazaar configuration: /home/MCDD/users/cad/davide/.bazaar
  Bazaar log file: /home/MCDD/users/cad/davide/.bzr.log

Tags: encoding
Revision history for this message
davidedb (davidedb-gmail) wrote :
Revision history for this message
John A Meinel (jameinel) wrote :

My best guess is that you have a non-ascii filename in your branch, but your local configuration is indicating that your filesystem only supports ASCII filenames.
Which is also supported by the line:
0.169 encoding stdout as sys.stdout encoding 'ANSI_X3.4-1968'

You probably could do "export LANG=en_US.UTF-8" or some equivalent. I'm not sure why your system feels that it is ascii-only. It is far more common to have systems default to UTF-8 or even latin-1/iso-8859-1.

Changed in bzr:
status: New → Incomplete
Revision history for this message
davidedb (davidedb-gmail) wrote :

Your guess is right: in my environment LANG is set to "C" for compatibility with old programs giving wrong results with other locales.
After I changed LANG's value to "en_US.UTF-8", I was able to create the branch successfully.

However it would be nice if bzr could catch such an exception and quit gracefully, instead of emitting a stack trace.

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

I can still reproduce this. Indeed, we can't really do much at the moment but report a sensible error and exit.

Changed in bzr:
status: Incomplete → Triaged
importance: Undecided → Medium
tags: added: encoding
Vincent Ladeuil (vila)
Changed in bzr:
status: Triaged → Confirmed
Revision history for this message
Martin Packman (gz) wrote :

From bzr 2.5 file handling defaults to using utf-8 even in the C locale.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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