Pythonの設定方法(text_factory)
あるシステムを実行すると、下記エラーが表示されました。
---------------
Traceback (most recent call last):
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\web\api.py", line 446, in send_error
data, 'text/html')
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\web\chrome.py", line 830, in render_template
message = req.session.pop('chrome.%s.%d' % (type_, i))
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\web\api.py", line 216, in __getattr__
value = self.callbacks[name](self)
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\web\main.py", line 306, in _get_session
return Session(self.env, req)
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\web\session.py", line 223, in __init__
self.promote_session(sid)
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\web\session.py", line 282, in promote_session
@self.env.with_transaction()
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\db\api.py", line 77, in transaction_wrapper
fn(ldb)
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\web\session.py", line 287, in update_session_id
""", (sid, self.req.authname))
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\db\util.py", line 65, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\db\sqlite_backend.py", line 78, in execute
result = PyFormatCursor.execute(self, *args)
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\db\sqlite_backend.py", line 56, in execute
args or [])
File "C:\TracLight\python\lib\site-packages\trac-0.12.4.ja1-py2.6.egg\trac\db\sqlite_backend.py", line 48, 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で、 text_factory = str を設定したら良いとわかりましたが、設定方法が
わかりません。
対話モードで設定したら良いのでしょうか?
Pythonに関しては全然わからないのでどのように設定したら良いかがわかりません。
教えてください。
よろしくお願いします。