Roundup 1.2.1, Python 2.5 and sqlite:
UnicodeEncodeError for German umlauts
I have installed Roundup 1.2.1 on Windows with Python
2.5 and am using the sqlite backend (with the sqlite
that is now included in the Python 2.5 distribution).
When trying to save a message that contains German
umlauts (äöü), an exception occurs.
I get the following traceback:
Traceback (most recent call last):
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\client.py",
line 730, in renderContext
result = pt.render(self, None, None, **args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\templating.py",
line 323, in render
getEngine().getContext(c), output, tal=1,
strictinsert=0)()
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 192, in __call__
self.interpret(self.program)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 236, in interpret
handlers[opcode](self, args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 666, in do_useMacro
self.interpret(macro)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 236, in interpret
handlers[opcode](self, args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 411, in do_optTag_tal
self.do_optTag(stuff)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 396, in do_optTag
return self.no_tag(start, program)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 391, in no_tag
self.interpret(program)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 236, in interpret
handlers[opcode](self, args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 689, in do_defineSlot
self.interpret(slot)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 236, in interpret
handlers[opcode](self, args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 632, in do_condition
self.interpret(block)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 236, in interpret
handlers[opcode](self, args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 632, in do_condition
self.interpret(block)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 236, in interpret
handlers[opcode](self, args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 608, in do_loop_tal
self.interpret(block)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 236, in interpret
handlers[opcode](self, args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 411, in do_optTag_tal
self.do_optTag(stuff)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 396, in do_optTag
return self.no_tag(start, program)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 391, in no_tag
self.interpret(program)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 236, in interpret
handlers[opcode](self, args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 544, in do_insertTranslation
self.interpretWithStream(stuff[1], tmpstream)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 216, in interpretWithStream
self.interpret(program)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 236, in interpret
handlers[opcode](self, args)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\TAL\TALInterpreter.py",
line 516, in do_i18nVariable
value = self.engine.evaluate(expression)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\PageTemplates\TALES.py",
line 227, in evaluate
return expression(self)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\PageTemplates\Expressions.py",
line 194, in __call__
return self._eval(econtext)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\PageTemplates\Expressions.py",
line 182, in _eval
ob = self._subexprs[-1](econtext)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\PageTemplates\Expressions.py",
line 138, in _eval
ob = restrictedTraverse(ob, path, getSecurityManager())
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\PageTemplates\Expressions.py",
line 317, in restrictedTraverse
o = guarded_getattr(object, name, M)
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\templating.py",
line 830, in __getattr__
return self[attr]
File
"C:\Programme\Python25\lib\site-packages\roundup\cgi\templating.py",
line 807, in __getitem__
value = self._klass.get(self._nodeid, items[0], None)
File
"C:\Programme\Python25\lib\site-packages\roundup\backends\rdbms_common.py",
line 2626, in get
return Class.get(self, nodeid, propname, default)
File
"C:\Programme\Python25\lib\site-packages\roundup\backends\rdbms_common.py",
line 1460, in get
d = self.db.getnode(self.classname, nodeid)
File
"C:\Programme\Python25\lib\site-packages\roundup\backends\rdbms_common.py",
line 963, in getnode
value =
self.sql_to_hyperdb_value[props[name].__class__](value)
UnicodeEncodeError: 'ascii' codec can't encode
characters in position 0-2: ordinal not in range(128)
The problem does not occur with Roundup 1.2.1, Python
2.4.4 and pysqlite 1.1.8.
I also wanted to try Roundup 1.2.1, Python 2.4.4 and
pysqlite 2.3.2, but this combination gave me the
following error during tracker initialisation:
Traceback (most recent call last):
File "<string>", line 1, in ?
File
"C:\Python24\Lib\site-packages\roundup\scripts\roundup_admin.py",
line 38, in run
sys.exit(tool.main())
File
"C:\Python24\Lib\site-packages\roundup\admin.py", line
1491, in main
ret = self.run_command(args)
File
"C:\Python24\Lib\site-packages\roundup\admin.py", line
1369, in run_command
return self.do_initialise(self.tracker_home, args)
File
"C:\Python24\Lib\site-packages\roundup\admin.py", line
514, in do_initialise
tracker.init(password.Password(adminpw))
File
"C:\Python24\Lib\site-packages\roundup\instance.py",
line 154, in init
db = self.open('admin')
File
"C:\Python24\Lib\site-packages\roundup\instance.py",
line 84, in open
vars = {
File
"C:\Python24\Lib\site-packages\roundup\backends\rdbms_common.py",
line 129, in __init__
self.open_connection()
File
"C:\Python24\Lib\site-packages\roundup\backends\back_sqlite.py",
line 114, in open_connection
(self.conn, self.cursor) = self.sql_open_connection()
File
"C:\Python24\Lib\site-packages\roundup\backends\back_sqlite.py",
line 105, in sql_open_connection
conn = sqlite.connect(db=db)
TypeError: function takes at least 1 argument (0 given) |