Hi I've done a fresh install of ubuntu and downloaded tg via svn.
When I try to access mysql through the following code I get the
infamous unicode error.
createadmin(self,name,email,state,city,companyorschool,username,password,admin_auth_key,submit=""):
sresult = Admin.select(Admin.q.username == username)
--> ul = list(sresult)
if len(ul) > 0:
return 'That administrator username is already in use.'
#put this in a kid template
Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py",
line 105, in _run
self.main()
File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py",
line 254, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in createadmin
File "/home/ben/turbogears/turbogears/controllers.py", line 160, in
validate
return errorhandling.run_with_errors(errors, func, *args, **kw)
File "/home/ben/turbogears/turbogears/errorhandling.py", line 87, in
run_with_errors
return dispatch_error(self, func, errors, None, *args, **kw)
File "<string>", line 5, in dispatch_error
File "/home/ben/turbogears/turbogears/errorhandling.py", line 62, in
adaptor
return adapt_call(func, *args, **kw)
File "/home/ben/turbogears/turbogears/util.py", line 163, in
adapt_call
return func(*args, **kw)
File "<string>", line 3, in createadmin
File "/home/ben/turbogears/turbogears/controllers.py", line 114, in
validate
return func(*args, **kw)
File "<string>", line 3, in createadmin
File "/home/ben/turbogears/turbogears/controllers.py", line 281, in
expose
output = database.run_with_transaction(
File "<string>", line 5, in run_with_transaction
File "/home/ben/turbogears/turbogears/database.py", line 246, in
so_rwt
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/home/ben/turbogears/turbogears/controllers.py", line 298, in
<lambda>
mapping, fragment, args, kw)))
File "/home/ben/turbogears/turbogears/controllers.py", line 322, in
_execute_func
output = errorhandling.try_call(func, *args, **kw)
File "/home/ben/turbogears/turbogears/errorhandling.py", line 68, in
try_call
return func(self, *args, **kw)
File "/home/ben/hcc/hcc/controllers.py", line 102, in createadmin
ul = list(sresult)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1860-py2.4.egg/sqlobject/sresults.py",
line 155, in __iter__
return iter(list(self.lazyIter()))
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1860-py2.4.egg/sqlobject/sresults.py",
line 163, in lazyIter
return conn.iterSelect(self)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1860-py2.4.egg/sqlobject/dbconnection.py",
line 364, in iterSelect
select, keepConnection=False)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1860-py2.4.egg/sqlobject/dbconnection.py",
line 704, in __init__
self.dbconn._executeRetry(self.rawconn, self.cursor, self.query)
File
"/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1860-py2.4.egg/sqlobject/mysql/mysqlconnection.py",
line 73, in _executeRetry
myquery = unicode(query, self.encoding)
TypeError: decoding Unicode is not supported
It never did this before what do you think is wrong. Is it somekind of
new thing with mysql or mysqldb or sqlobject. How can I fix this? I
saw the other posts regarding unicode but I'm confused still.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---