"bzr: ERROR: exceptions.UnicodeEncodeError: 'ascii' codec can't encode character" ... when trying to modify a file in an SVN repository with a unicode filename

Bug #230090 reported by Wesley J. Landaker
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Medium
Jelmer Vernooij

Bug Description

See the following for how to reproduce this error:

$ svnadmin create repo
$ svn co file://`pwd`/repo svn
Checked out revision 0.
$ bzr co svn+file://`pwd`/repo bzr
Initialising Subversion metadata cache in /home/wjlanda/.bazaar/svn-cache/d67dcf40-8da0-44ec-8248-1374ec633da5
$ cd svn/
$ touch I²C
$ svn add I²C
A I²C
$ svn commit -m "Adding file."
Adding I²C
Transmitting file data .
Committed revision 1.
$ cd ..
$ cd bzr/
$ bzr up
+N I²C
All changes applied successfully.
Updated to revision 2.
$ vi I²C
$ bzr diff
=== modified file 'I²C'
--- I²C 2008-05-13 20:22:41 +0000
+++ I²C 2008-05-13 20:22:56 +0000
@@ -0,0 +1,1 @@
+changes

$ bzr commit -m "Changes."
Committing to: svn+file:///home/wjlanda/work/tmp/debug-svn/repo
modified I²C
bzr: ERROR: exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\xb2' in position 2: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 802, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 504, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2381, in run
    author=author)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 246, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 190, in commit
    revprops=revprops, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commit.py", line 388, in commit
    revision_id=self.rev_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 947, in fetch
    return inter.fetch(revision_id=revision_id, pb=pb, find_ghosts=find_ghosts)
  File "/home/wjlanda/.bazaar/plugins/svn/commit.py", line 791, in fetch
    self.copy_content(revision_id=revision_id, pb=pb)
  File "/home/wjlanda/.bazaar/plugins/svn/commit.py", line 784, in copy_content
    push_revision_tree(target_branch, target_branch.get_config(), self.source, parent_revid, revision_id, rev)
  File "/home/wjlanda/.bazaar/plugins/svn/commit.py", line 689, in push_revision_tree
    builder.commit(rev.message)
  File "/home/wjlanda/.bazaar/plugins/svn/commit.py", line 491, in commit
    branch_batons[-1])
  File "/home/wjlanda/.bazaar/plugins/svn/commit.py", line 266, in _dir_process
    baton, self.base_revnum, self.pool)
  File "/home/wjlanda/.bazaar/plugins/svn/errors.py", line 105, in convert
    return unbound(*args, **kwargs)
  File "/home/wjlanda/.bazaar/plugins/svn/transport.py", line 159, in open_file
    parent_baton, *args, **kwargs)
  File "/var/lib/python-support/python2.5/libsvn/delta.py", line 529, in svn_delta_editor_invoke_open_file
    return apply(_delta.svn_delta_editor_invoke_open_file, args)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb2' in position 2: ordinal not in range(128)

bzr 1.4 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'commit', '-m', 'Changes.']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bisect /home/wjlanda/.bazaar/plugins/bisect [1.1.0pre0]
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.4.0]
  cvsps /home/wjlanda/.bazaar/plugins/cvsps [unknown]
  gtk /home/wjlanda/.bazaar/plugins/gtk [0.95.0dev1]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  loom /home/wjlanda/.bazaar/plugins/loom [1.4.0dev0]
  rebase /home/wjlanda/.bazaar/plugins/rebase [0.3.0]
  stats /home/wjlanda/.bazaar/plugins/stats [unknown]
  svn /home/wjlanda/.bazaar/plugins/svn [0.4.11dev0]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.
$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en_GB:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Related branches

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 230090] [NEW] "bzr: ERROR: exceptions.UnicodeEncodeError: 'ascii' codec can't encode character" ... when trying to modify a file in an SVN repository with a unicode filename

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  status fixcommitted
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBSCt/hgy0JeEGD2blAQJzAwP+OugaYZiL14ruyJVDNvZTxHHAMKV/bUBQ
oSNZf/5uNdSDFrBokBOi29o5Vf4EzxwGL932i4Js2NjLxqqHACAesEQh+LHZz9bG
fDgWP1YT+9GNmfVsn8PK/dEIQGWTnauhwzUchYUe9BGJ4K/qAt7RpSOQGIxFVTYs
vomcziUKZpw=
=lK+D
-----END PGP SIGNATURE-----

Changed in bzr-svn:
status: New → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
importance: Undecided → Medium
milestone: none → 0.4.11
assignee: nobody → jelmer
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Fix Committed → 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.