sqlite3.ProgrammingError while branching svn repo with non-ascii filenames

Bug #1051303 reported by Artem Sulimov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
New
Undecided
Unassigned

Bug Description

When running recent bzr co svn://192.168.1.2/trunk
on Fedora12 x86_64
bazaar crashes with the following backtrace:

bzr: ERROR: sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.

Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 920, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 1131, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 695, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/builtins.py", line 1654, in run
    accelerator_tree, hardlink)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/branch.py", line 437, in create_checkout
    hardlink=hardlink)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/branch.py", line 368, in _create_heavyweight_checkout
    checkout_branch.pull(self, stop_revision=revision_id)
  File "/usr/lib64/python2.6/site-packages/bzrlib/branch.py", line 1133, in pull
    possible_transports=possible_transports, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/branch.py", line 1000, in pull
    fetch_non_mainline=fetch_non_mainline)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/branch.py", line 954, in _basic_pull
    self._update_tags(result, overwrite, tags_since_revnum)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/branch.py", line 912, in _update_tags
    _to_revnum=self.source.repository.get_latest_revnum())
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/tags.py", line 396, in merge_to
    graph, to_tags.branch.last_revision())
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/tags.py", line 315, in _resolve_tags_ancestry
    reverse_tag_revmetas))
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/tags.py", line 67, in _resolve_reverse_tags_fallback
    revid = revmeta.get_revision_id(mapping)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/revmeta.py", line 147, in get_revision_id
    (_, revid, _) = self.get_revision_info(mapping)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/revmeta.py", line 810, in get_revision_info
    self._retrieve(mapping)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/revmeta.py", line 761, in _retrieve
    self.metarev.get_foreign_revid(), mapping)
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/cache/sqlitecache.py", line 281, in get_revision
    row = self.execute("select revno, revid, hidden, stored_lhs_parent_revid from revmetainfo where path = ? and revnum = ? and mapping = ?", (foreign_revid[1], foreign_revid[2], mapping.name)).fetchone()
  File "/usr/lib/python2.6/site-packages/bzrlib/plugins/svn/cache/sqlitecache.py", line 102, in execute
    return self.cachedb.execute(*args, **kwargs)
ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.

bzr 2.5.1 on python 2.6.2 (Linux-2.6.32.26-175.fc12.x86_64-x86_64-with-
    fedora-12-Constantine)
arguments: ['/usr/bin/bzr', 'co', 'svn://192.168.1.2/trunk']
plugins: bash_completion[2.5.1], bzrtools[2.5.0], changelog_merge[2.5.1],
    launchpad[2.5.1], netrc_credential_store[2.5.1], news_merge[2.5.1],
    po_merge[2.5.1], svn[1.2.2], weave_fmt[2.5.1]
encoding: 'utf-8', fsenc: 'UTF-8', lang: 'ru_RU.UTF-8'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Revision history for this message
Artem Sulimov (tsxv) wrote :

Disabling sqlite3 cache solves the problem, but is not a solution for me as work with svn repo becomes very slow.

Here is a workaround found on some china forum:
in the file sqlitecache.py.patch
in the method CacheTable.__init__
add the line
self.cachedb.text_factory = sqlite3.OptimizedUnicode
before setting _commit_interval.

This works fine for me and it seems that makes no side effects.

Artem Sulimov (tsxv)
description: updated
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.