UnicodeDecodeError while attempting to version home dir with 'bzr init'

Bug #561711 reported by Zillode
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

I was trying to use bazaar to version my home folder. The first command bzr init gave me the following error:

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

Traceback:
 Traceback (most recent call last):
   File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 853, in exception_to_return_code
     return the_callable(*args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1055, in run_bzr
     ret = run(*run_argv)
   File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 661, in run_argv_aliases
     return self.run_direct(**all_cmd_args)
   File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 665, in run_direct
     return self._operation.run_simple(*args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 122, in run_simple
     self.cleanups, self.func, *args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
     result = func(*args, **kwargs)
   File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 1730, in run
     possible_transports=[to_transport])
   File "/usr/lib/python2.6/dist-packages/bzrlib/bzrdir.py", line 532, in create_branch_convenience
     bzrdir.create_workingtree()
   File "/usr/lib/python2.6/dist-packages/bzrlib/bzrdir.py", line 1616, in create_workingtree
     accelerator_tree=accelerator_tree, hardlink=hardlink)
   File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree_4.py", line 1462, in initialize
     delta_from_tree=delta_from_tree)
   File "/usr/lib/python2.6/dist-packages/bzrlib/transform.py", line 2253, in build_tree
     delta_from_tree)
   File "/usr/lib/python2.6/dist-packages/bzrlib/transform.py", line 2269, in _build_tree
     for dir, files in wt.walkdirs():
   File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree.py", line 2466, in walkdirs
     current_disk = disk_iterator.next()
   File "/usr/lib/python2.6/dist-packages/bzrlib/osutils.py", line 1610, in walkdirs
     names = sorted(_listdir(top))
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xd6 in position 28: ordinal not in range(128)

Ubuntu karmic,
Tried bzr Nightly but experienced the same problem

Bazaar (bzr) 2.1.1

The immediate cause is bug 501307 (bzr init recursively scans directory contents), but even if that were fixed 'bzr add' would fail in a similar way.

Tags: unicode
Revision history for this message
Zillode (zillode) wrote :
Revision history for this message
Zillode (zillode) wrote :
Revision history for this message
Andrew Bennetts (spiv) wrote :

This is happening on 'bzr init' in a home directory. It appears there's a filename with an unexpected encoding somewhere in that directory. 'bzr init' probably shouldn't be scanning the entire directory in the first place, that's bug 501307. You'd still get a similar traceback on 'bzr add' even if bug 501307 were fixed, though, so I suppose this should be a separate bug.

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
description: updated
summary: - bzr: ERROR: exceptions.UnicodeDecodeError: 'ascii' codec can't decode
- byte 0xd6 in position 28: ordinal not in range(128)
+ UnicodeDecodeError while attempting to version home dir with 'bzr init'
Revision history for this message
Andrew Bennetts (spiv) wrote :

Btw, this can be easily reproduced (assuming a UTF-8 system) with:

#!/bin/bash
mkdir crash-test
cd crash-test
# create non-ascii file
touch odd-file-ë.txt
LANG=C bzr init

Parth Malwankar (parthm)
tags: added: unicode
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.