sqlobject/mysql error

2 views
Skip to first unread message

viyyer

unread,
Mar 23, 2006, 3:31:09 AM3/23/06
to TurboGears
Hi,
I am encountering a strange problem recurring in long intervals.
what is this mainly related to ?
cheers
Vivek
500 Internal error

Server got itself in trouble

Traceback (most recent call last):
File "/home/viyyer/lib/python2.4/site-packages/CherryPy-2.1.1-
py2.4.egg/cherrypy/_cphttptools.py", line 271, in run
main()
File "/home/viyyer/lib/python2.4/site-packages/CherryPy-2.1.1-
py2.4.egg/cherrypy/_cphttptools.py", line 502, in main
body = page_handler(*args, **cherrypy.request.paramMap)
File "/home/viyyer/lib/python2.4/site-packages/TurboGears-0.8.9-
py2.4.egg/turbogears/controllers.py", line 124, in newfunc
output = func(self, *args, **kw)
File "/home/viv/raqswiki/lexwiki/lexwiki/controllers.py", line 58,
in
index
alphas = [alpha.alphaname for alpha in
File "/home/viyyer/lib/python2.4/site-packages/
SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/sresults.py", line 149,
in
__iter__
return iter(list(self.lazyIter()))
File "/home/viyyer/lib/python2.4/site-packages/
SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/sresults.py", line 157,
in
lazyIter
return conn.iterSelect(self)
File "/home/viyyer/lib/python2.4/site-packages/
SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/dbconnection.py", line
361, in iterSelect
select, keepConnection=False)
File "/home/viyyer/lib/python2.4/site-packages/
SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/dbconnection.py", line
695, in __init__
self.dbconn._executeRetry(self.rawconn, self.cursor, self.query)
File "/home/viyyer/lib/python2.4/site-packages/
SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/mysql/
mysqlconnection.py",
line 60, in _executeRetry
return cursor.execute(query)
File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line
137,
in execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line
33, in defaulterrorhandler
raise errorclass, errorvalue
InterfaceError: (0, '')

Powered by

viyyer

unread,
Mar 23, 2006, 7:38:59 AM3/23/06
to TurboGears
hmm...curious.. why are the input from the forms are returned are
returned as string not unicode?
the type of parameters brought in from the form.
>>>type(data)
<'str'>
why is this so? how do I make my form return unicode string for the
forms.

Jorge Godoy

unread,
Mar 23, 2006, 8:05:06 AM3/23/06
to turbo...@googlegroups.com
"viyyer" <v.i...@gmail.com> writes:

Use UnicodeString as your validator. And use UTF-8 as the content-type of
your pages.

--
Jorge Godoy <jgo...@gmail.com>

viyyer

unread,
Mar 23, 2006, 11:51:46 PM3/23/06
to TurboGears
Solved the issue.
Jorge Godoy wrote:

> "viyyer" <v.i...@gmail.com> writes:
>
> Use UnicodeString as your validator. And use UTF-8 as the content-type of
> your pages.

I am using the utf-8 as content type.

I had to change the default encoding from 'ascii' to 'utf8'. I'm just
curious if it makes sense having all the TG stubcode with 'utf8'
default
encoding enabled.

one needs to have this in the start-projectname ( or
projectname-start.py in TG<0.9)

import sys
reload(sys)
sys.setdefaultencoding('utf8')

what say ?
cheers
Vivek

Jorge Godoy

unread,
Mar 24, 2006, 12:33:31 AM3/24/06
to turbo...@googlegroups.com
"viyyer" <v.i...@gmail.com> writes:

> import sys
> reload(sys)
> sys.setdefaultencoding('utf8')
>
> what say ?

This is a bug that was fixed in 0.9... It isn't needed anymore.

--
Jorge Godoy <jgo...@gmail.com>

Reply all
Reply to author
Forward
0 new messages