Crash on symlinks involving Unicode characters

Bug #319317 reported by Wesley J. Landaker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Jelmer Vernooij
Bazaar Subversion Plugin
Fix Released
Undecided
Jelmer Vernooij

Bug Description

This is split and simplified from bug #319313.

If there is a SVN repository with symlinks involving Unicode characters, it crashes bzr-svn.

Reproduction:

svnadmin create repos
svn co file://`pwd`/repos wc
cd wc
touch 𠀀
ln -s 𠀀 a
touch b
ln -s b 𠀁
svn add *
svn commit -m "Added files and links"
bzr up
bzr: ERROR: exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\U00020001' in position 47: ordinal not in range(128)

Traceback (most recent call last):
  File "/home/wjlanda/lib/python/bzrlib/commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/wjlanda/lib/python/bzrlib/commands.py", line 839, in run_bzr
    ret = run(*run_argv)
  File "/home/wjlanda/lib/python/bzrlib/commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/wjlanda/lib/python/bzrlib/builtins.py", line 1189, in run
    tree = WorkingTree.open_containing(dir)[0]
  File "/home/wjlanda/lib/python/bzrlib/workingtree.py", line 333, in open_containing
    return control.open_workingtree(), relpath
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 830, in open_workingtree
    return SvnWorkingTree(self, self.local_path, self.open_branch())
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 114, in __init__
    self._update_base_revnum(max_rev)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 551, in _update_base_revnum
    self.read_working_inventory()
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 422, in read_working_inventory
    add_dir_to_inv(u"", rootwc, None)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 416, in add_dir_to_inv
    add_file_to_inv(subrelpath, subid, subrevid, id)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 307, in add_file_to_inv
    file.symlink_target = os.readlink(self.abspath(relpath))
UnicodeEncodeError: 'ascii' codec can't encode character u'\U00020001' in position 47: ordinal not in range(128)

bzr 1.12dev on python 2.5.2 (linux2)
arguments: ['/home/wjlanda/bin/bzr', 'up']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bisect /home/wjlanda/.bazaar/plugins/bisect [1.1.0.pre.0]
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.11]
  cvsps_import /usr/lib/python2.5/site-packages/bzrlib/plugins/cvsps_import [unknown]
  gtk /home/wjlanda/.bazaar/plugins/gtk [0.96.0.dev.1]
  launchpad /home/wjlanda/lib/python/bzrlib/plugins/launchpad [unknown]
  loom /usr/lib/python2.5/site-packages/bzrlib/plugins/loom [1.4dev]
  netrc_credential_store /home/wjlanda/lib/python/bzrlib/plugins/netrc_credential_store [unknown]
  qbzr /home/wjlanda/.bazaar/plugins/qbzr [0.9.7dev]
  rebase /usr/lib/python2.5/site-packages/bzrlib/plugins/rebase [0.4.2]
  search /usr/lib/python2.5/site-packages/bzrlib/plugins/search [1.7dev]
  stats /usr/lib/python2.5/site-packages/bzrlib/plugins/stats [unknown]
  svn /home/wjlanda/.bazaar/plugins/svn [0.5rc1]
  upload /usr/lib/python2.5/site-packages/bzrlib/plugins/upload [0.1]
*** 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.

Revision history for this message
Wesley J. Landaker (wjl) wrote :

I reported a similar bug on bzr as bug #319323. It's not the same, though, because it crashes in bzrlib and this one crashes in bzr-svn.

Revision history for this message
Wesley J. Landaker (wjl) wrote :

You need the fix to bug #317644 applied before this shows up as described, otherwise it will crash because of that bug instead.

However, if you use BMP Unicode characters intead in the recipe above, you will get the same error. For this reason in bug #319323 I used α and β instead of 𠀀 and 𠀁. The problem is still the same, however.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 319317] Re: Crash on symlinks involving Unicode characters

Thanks for the bugreport. Fixed in the 0.5 branch.

  status fixreleased
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

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