bzr crashed with UnicodeDecodeError in write()

Bug #632705 reported by Martin Soto
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Fix Released
Jelmer Vernooij
bzr (Ubuntu)

Bug Description

Binary package hint: bzr

This happened when running 'bzr unshelve --preview'. The shelved patch includes at least one file that contains non-ASCIIi characters encoded in UTF-8. The patch is listed up to line that contains the non-ASCII character and then the exception occurs.

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: bzr 2.2.0-1
ProcVersionSignature: Ubuntu 2.6.35-19.28-generic
Uname: Linux 2.6.35-19-generic i686
Architecture: i386
BzrDebugFlags: set()
BzrVersion: 2.2.0
CommandLine: ['/usr/bin/bzr', 'unshelve', '--preview']
CrashDb: bzr
Date: Tue Sep 7 23:09:17 2010
ExecutablePath: /usr/bin/bzr
FileSystemEncoding: UTF-8
InterpreterPath: /usr/bin/python2.6
Locale: en_US.utf8
Platform: Linux-2.6.35-19-generic-i686-with-Ubuntu-10.10-maverick
ProcCmdline: /usr/bin/python /usr/bin/bzr unshelve --preview
 PATH=(custom, user)
PythonVersion: 2.6.6
SourcePackage: bzr
Title: bzr crashed with UnicodeDecodeError in write()
UserEncoding: UTF-8
UserGroups: adm admin audio cdrom dialout floppy lpadmin plugdev scanner src video

Revision history for this message
Martin Soto (soto255) wrote :
tags: removed: need-duplicate-check
Andreas Olsson (andol)
visibility: private → public
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: New → Confirmed
Changed in bzr:
status: New → Confirmed
Revision history for this message
Per Ångström (autark) wrote :
Download full text (3.8 KiB)

$ bzr unshelve --preview
Using changes with id "1".
 M gensite.rb
Text conflict in gensite.rb
=== modified file 'gensite.rb'
--- a/gensite.rb 2010-11-25 15:07:48 +0000
+++ b/gensite.rb 2011-04-17 05:57:55 +0000
@@ -236,7 +236,12 @@
 RewriteEngine On
 RewriteCond %{HTTP_HOST} ^example\.com
 RewriteRule (.*)$1 [R=301,L]
+<<<<<<< TREE
+SetEnv PERL5LIB /home/perang/perl5/lib/perl5/i486-linux-gnu-thread-multi:/home/perang/perl5/lib/perl5
bzr: failed to report crash using apport:
     OSError(13, 'Permission denied')
bzr: ERROR: exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xa7 in position 5: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 690, in run_argv_aliases
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 5923, in run
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 480, in run
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 499, in write_diff
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 493, in show_diff_trees
    return differ.show_diff(specific_files, extra_trees)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 942, in show_diff
    return self._show_diff(specific_files, extra_trees)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 1002, in _show_diff
    self._diff(file_id, oldpath, newpath, kind[0], kind[1])
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 1028, in _diff
    new_path, old_kind, new_kind)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 555, in _diff_many
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 693, in diff
    old_path, new_path)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 716, in diff_text
    self.to_file, path_encoding=self.path_encoding)
  File "/usr/lib/python2.6/dist-packages/bzrlib/", line 117, in internal_diff
  File "/usr/lib/python2.6/dist-packages/bzrlib/ui/", line 538, in write
  File "/usr/lib/python2.6/", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa7 in position 5: ordinal not in range(128)

bzr 2.2.1 on...


Jelmer Vernooij (jelmer)
Changed in bzr:
importance: Undecided → Medium
Changed in bzr (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
tags: added: terminal-encoding
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
Changed in brz:
milestone: none → 3.0.0
assignee: nobody → Jelmer Vernooij (jelmer)
status: New → Fix Released
importance: Undecided → Medium
tags: removed: check-for-breezy
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.