Crash when repository is in a directory with non ascii characters

Bug #163123 reported by GrdScarabe
2
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

This bug may be equivalent or close to #63324 or #84043

When a repository is created within a directory with non ascii characters, it is possible to "bzr init" and "bzr add" but when you "bzr commit", the application crashes with error :

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

However if you specify the commit comment with the -m option, it works !

The result of "locale" :

LANG=fr_FR.UTF-8
LANGUAGE=fr_FR:fr:en_GB:en
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=

To reproduce it :

~/tmp$ mkdir Thèse
~/tmp$ cd Thèse/
~/tmp/Thèse$ bzr init
~/tmp/Thèse$ touch bar
~/tmp/Thèse$ bzr add .
added bar
~/tmp/Thèse$ bzr commit
Committing revision 1 to "/home/pinot/tmp/Thèse/".
added bar
bzr: ERROR: exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 18: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 802, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 758, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 2315, in run
    author=author)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/workingtree_4.py", line 244, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/mutabletree.py", line 187, in commit
    revprops=revprops, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/commit.py", line 356, in commit
    message = message_callback(self)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 2296, in get_message
    my_message = edit_commit_message_encoded(t)
  File "/usr/lib/python2.4/site-packages/bzrlib/msgeditor.py", line 132, in edit_commit_message_encoded
    msgfilename, hasinfo = _create_temp_file_with_commit_template(
  File "/usr/lib/python2.4/site-packages/bzrlib/msgeditor.py", line 208, in _create_temp_file_with_commit_template
    text=True)
  File "tempfile.py", line 302, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags)
  File "tempfile.py", line 238, in _mkstemp_inner
    return (fd, _os.path.abspath(file))
  File "posixpath.py", line 403, in abspath
    path = join(os.getcwd(), path)
  File "posixpath.py", line 65, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 18: ordinal not in range(128)

bzr 0.92.0 on python 2.4.4.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'commit']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'fr_FR.UTF-8'
plugins:
  launchpad /usr/lib/python2.4/site-packages/bzrlib/plugins/launchpad [unknown]
  lessdiff /home/pinot/.bazaar/plugins/lessdiff [unknown]
  multiparent /usr/lib/python2.4/site-packages/bzrlib/plugins/multiparent.pyc [unknown]

** Please send this report to <email address hidden>
   with a description of what you were doing when the
   error occurred.
~/tmp/Thèse$ bzr commit -m "initial commit"
Committing revision 1 to "/home/pinot/tmp/Thèse/".
added bar
Committed revision 1.

Revision history for this message
John A Meinel (jameinel) wrote :

This is indeed a duplicate of bug #84043

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.