UnicodeEncodeError on mv of a deleted non-ascii file

Bug #898541 reported by Martin Packman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Martin Packman

Bug Description

Trying to `bzr mv` a versioned file that has been deleted or renamed outside of bzr throws a UnicodeEncodeError, for instance with the commands:

    bzr init
    bzr mkdir £
    rmdir £
    bzr mv £ d

This results in the following traceback:

    Traceback (most recent call last):
      File ".../bzrlib/commands.py", line 923, in exception_to_return_code
        return the_callable(*args, **kwargs)
      File ".../bzrlib/commands.py", line 1128, in run_bzr
        ret = run(*run_argv)
      File ".../bzrlib/commands.py", line 676, in run_argv_aliases
        return self.run(**all_cmd_args)
      File ".../bzrlib/commands.py", line 698, in run
        return self._operation.run_simple(*args, **kwargs)
      File ".../bzrlib/cleanup.py", line 135, in run_simple
        self.cleanups, self.func, *args, **kwargs)
      File ".../bzrlib/cleanup.py", line 165, in _do_with_cleanups
        result = func(*args, **kwargs)
      File ".../bzrlib/builtins.py", line 891, in run
        self._run(tree, names_list, rel_names, after)
      File ".../bzrlib/builtins.py", line 981, in _run
        tree.rename_one(src, dest, after=after)
      File ".../bzrlib/mutabletree.py", line 51, in tree_write_locked
        return unbound(self, *args, **kwargs)
      File ".../bzrlib/workingtree_4.py", line 1299, in rename_one
        super(DirStateWorkingTree, self).rename_one(from_rel, to_rel, after)
      File ".../bzrlib/mutabletree.py", line 51, in tree_write_locked
        return unbound(self, *args, **kwargs)
      File ".../bzrlib/workingtree.py", line 2659, in rename_one
        rename_entries = self._determine_mv_mode(rename_entries, after)
      File ".../bzrlib/workingtree.py", line 2751, in _determine_mv_mode
        errors.PathsDoNotExist(paths=(str(from_rel),
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 0: ordinal not in range(128)

As always, calling str() on a path is bogus.

Related branches

Martin Packman (gz)
Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Martin Packman (gz)
description: updated
Martin Packman (gz)
Changed in bzr:
assignee: nobody → Martin Packman (gz)
status: Confirmed → In Progress
Martin Packman (gz)
Changed in bzr:
milestone: none → 2.5b5
status: In Progress → Fix Released
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.