Trac-ja 0.11.1で新規プロジェクトを作るとエラーになる
Trac-jaをアップグレードした時に、既存のプロジェクトは問題なかったんですが、新規プロジェクトを作ると次のようなエラーが出てしまいました。(/path/to/projectは新規プロジェクトのパス)
Creating and Initializing Project Initenv for '/path/to/project' failed. Failed to create environment. 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/local/lib/python2.5/site-packages/Trac-0.11.1.ja1-py2.5.egg/trac/admin/console.py", line 568, in do_initenv options=options) File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1.ja1-py2.5.egg/trac/env.py", line 194, in __init__ setup_participant.environment_created() File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1.ja1-py2.5.egg/trac/env.py", line 480, in environment_created vals) File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1.ja1-py2.5.egg/trac/db/util.py", line 57, in executemany return self.cursor.executemany(sql_escape_percent(sql), args) File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1.ja1-py2.5.egg/trac/db/sqlite_backend.py", line 63, in executemany args or []) File "/usr/local/lib/python2.5/site-packages/Trac-0.11.1.ja1-py2.5.egg/trac/db/sqlite_backend.py", line 50, in _rollback_on_error return function(self, *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.
Python素人ですが、どうやらUnicode文字列(Unicode strings)を使ってないところで問題が出てるっぽい?
ということで調べてったら、Trac-0.11.1.ja1-py2.5.egg/trac/db_default.pyのSQL文が、カラム名日本語なのにUnicode文字列になってないので、修正したらなんか旨くいったっぽい。
調べてみたら、Trac-ja 0.10だとカラム名はすべて英語(Ascii)だったようなので、修正漏れなんですかね。<2008-10-15追記>Trac.ja→Trac-jaに修正