Bzr crashes while trying to init a new repository

Bug #455503 reported by Raphael Toselli
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

I suspect that this error occurs when you have some weird character in the file/dir name where you try to start the new repository.

Traceback as follows:

bzr: ERROR: exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc7 in position 3: ordinal not in range(128)

Traceback (most recent call last):
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/commands.py", line 842, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/commands.py", line 1037, in run_bzr
    ret = run(*run_argv)
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/commands.py", line 654, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/builtins.py", line 1713, in run
    possible_transports=[to_transport])
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 532, in create_branch_convenience
    bzrdir.create_workingtree()
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 1609, in create_workingtree
    accelerator_tree=accelerator_tree, hardlink=hardlink)
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/workingtree_4.py", line 1473, in initialize
    delta_from_tree=delta_from_tree)
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/transform.py", line 2147, in build_tree
    delta_from_tree)
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/transform.py", line 2163, in _build_tree
    for dir, files in wt.walkdirs():
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/workingtree.py", line 2382, in walkdirs
    current_disk = disk_iterator.next()
  File "/opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/osutils.py", line 1399, in walkdirs
    names = sorted(_listdir(top))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc7 in position 3: ordinal not in range(128)

bzr 2.0.1 on python 2.4.6 (Linux-2.6.18-128.1.10.el5-i686-with-redhat-5.3-Final)
arguments: ['/opt/python/python-2.4.6/bin/bzr', 'init']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'pt_BR.UTF-8'
plugins:
  launchpad /opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/plugins/launchpad [2.0.1]
  netrc_credential_store /opt/python/python-2.4.6/lib/python2.4/site-packages/bzrlib/plugins/netrc_credential_store [2.0.1]

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 455503] [NEW] Bzr crashes while trying to init a new repository

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Raphael Toselli wrote:
> Public bug reported:
>
> I suspect that this error occurs when you have some weird character in
> the file/dir name where you try to start the new repository.
>
> Traceback as follows:
>
> bzr: ERROR: exceptions.UnicodeDecodeError: 'ascii' codec can't decode
> byte 0xc7 in position 3: ordinal not in range(128)

This is happening because you are doing "bzr init" in a directory with
non-ascii filenames, but you have your system configured to believe it
is ascii. As such, we don't know how to decode the filenames. (The
traceback is bad, but we will fail one way or another later anyway.)

If you know how the filenames are encoded (such as UTF-8) you should be
able to do something like:
  export LANG=en_US.UTF-8

(or whatever your preferred language is.)

You might try:
  echo $LANG

to see what your lang is set to already.

John
=;->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrd3NkACgkQJdeBCYSNAAMXKQCghVnovce1R9s+unYB4agAEyHe
zzMAoIq6nj6RsAab4Dlv4fWQJrl6eKWp
=uIS2
-----END PGP SIGNATURE-----

Revision history for this message
David Roberts (smartgpx) wrote :

Pardon me asking a 'dumb' question, but did you type -
 bzr [path/to/repo] init

or

 bzr init [path/to/repo]

?

(On Windows the arguments to bzr are reported in the order they appear on the command line - if *nix reports the same way then I think perhaps the arguments are reversed?? Maybe bzr tries to do something odd if you pass its own executable as an argument?)

Revision history for this message
Raphael Toselli (rtoselli) wrote :

@david

I am starting the repo on the working dir, issuing only "bzr init".

@john

So, I tried both above, and i still get the same error, my lang is set to pt_BR.UTF-8 any suggestions?

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.