conflicts involving unicode paths can't be displayed

Bug #686161 reported by Dmitry
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Martin Packman
bzr (Ubuntu)
Fix Released
Low
Jelmer Vernooij

Bug Description

Binary package hint: bzr

1) Have added file with Russian letters in filename
2) Removed that file in working copy under Windows environment. Committed changes
3) Updated to latest version in Linux env
4) Got message about conflicts
5) Typed "bzr conficts" to see conflicted files.
6) Crash

I'm not 100% sure, but there are changes in file with Russian file in Linux working copy. So, I think conflicted file was file with Russian filename

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: bzr 2.2.1-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-23.41-generic 2.6.35.7
Uname: Linux 2.6.35-23-generic x86_64
Architecture: amd64
BzrDebugFlags: set()
BzrVersion: 2.2.1
CheckboxSubmission: 272fa71ee0096ff4d4382780d250f425
CheckboxSystem: 2954e74ba17fb0e37fc942cd1d9fab4e
CommandLine: ['/usr/bin/bzr', 'conflicts']
CrashDb: bzr
Date: Mon Dec 6 22:37:46 2010
ExecutablePath: /usr/bin/bzr
FileSystemEncoding: UTF-8
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
InterpreterPath: /usr/bin/python2.6
Locale: ru_RU.utf8
Platform: Linux-2.6.35-23-generic-x86_64-with-Ubuntu-10.10-maverick
ProcCmdline: /usr/bin/python /usr/bin/bzr conflicts
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=ru_RU.utf8
PythonVersion: 2.6.6
SourcePackage: bzr
Title: bzr crashed with UnicodeEncodeError in run()
UserEncoding: UTF-8
UserGroups: adm admin audio cdrom dialout lpadmin netdev plugdev sambashare video

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/conflicts.py", line 76, in run
    self.outf.write(str(conflict) + '\n')
UnicodeEncodeError: 'ascii' codec can't encode characters in position 25-30: ordinal not in range(128)

Related branches

Revision history for this message
Dmitry (alexandrov-dmitry) wrote :
tags: removed: need-duplicate-check
Martin Pool (mbp)
description: updated
Martin Pool (mbp)
visibility: private → public
Revision history for this message
Martin Packman (gz) wrote :

Accidentally changed bug 686735 rather than this one...

Can hit the problem by making the blackbox tests use a non-ascii path like so:

=== modified file 'bzrlib/tests/blackbox/test_conflicts.py'
--- bzrlib/tests/blackbox/test_conflicts.py 2010-11-07 16:32:51 +0000
+++ bzrlib/tests/blackbox/test_conflicts.py 2011-04-13 14:05:01 +0000
@@ -43,7 +43,7 @@
         ('%s/myfile' % (this_path,), 'contentsa2\n'),
         ('%s/my_other_file' % (this_path,), 'contentsa2\n'),
         ])
- this_tree.rename_one('mydir', 'mydir3')
+ this_tree.rename_one('mydir', u'mydir3\xa0')
     this_tree.commit(message='change')
     this_tree.merge_from_branch(other_tree.branch)
     return this_tree, other_tree

Changed in bzr:
assignee: nobody → Martin [gz] (gz)
importance: Undecided → Low
status: New → In Progress
Revision history for this message
John A Meinel (jameinel) wrote :

Hey Martin, what's your status on this? Anything we can do to help you along?

Revision history for this message
Martin Packman (gz) wrote :

I have a branch for this. The basic fix is pretty simple, the complicating factors are making sure the ui stuff doesn't then mangle it anyway and needing to rewrite bb.test_conflicts to cover all the different cases.

Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Vincent Ladeuil (vila)
summary: - bzr crashed with UnicodeEncodeError in run()
+ conflicts involving unicode paths can't be displayed
Martin Packman (gz)
Changed in bzr:
milestone: none → 2.4b3
status: In Progress → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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