#998: Unicode instead of str in SQL query (CatWalk)
---------------------------------------------------+------------------------
 Reporter:  vfigueiro                              |        Owner:  Chris Arndt 
     Type:  defect                                 |       Status:  new         
 Priority:  normal                                 |    Milestone:  1.0.x bugfix
Component:  Toolbox.Catwalk                        |      Version:  1.0b1       
 Severity:  normal                                 |   Resolution:              
 Keywords:  needs confirmation, catwalk, unicode,  |  
---------------------------------------------------+------------------------
Changes (by Chris Arndt):

  * keywords:  catwalk unicode query => needs confirmation, catwalk,
               unicode,
  * owner:  anonymous => Chris Arndt
  * milestone:  1.x => 1.0.x bugfix

Old description:

> When I select the browse view in CatWalk and the selected SO has non-
> ascii titles, I get the following output:
>
> 2006-06-22 21:14:42,409 cherrypy.msg INFO HTTP: Page handler: <bound
> method Browse.index of <turbogears.toolbox.catwalk.browse.Browse object
> at 0x40b2e72c>>
> 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 index
>   File "/home/vfigueiro/dev/tg/turbogears/turbogears/controllers.py",
> line 280, in expose
>     output = database.run_with_transaction(
>   File "/home/vfigueiro/dev/tg/turbogears/turbogears/database.py", line
> 221, in run_with_transaction
>     retval = func(*args, **kw)
>   File "<string>", line 5, in _expose
>   File "/home/vfigueiro/dev/tg/turbogears/turbogears/controllers.py",
> line 297, in <lambda>
>     mapping, fragment, *args, **kw)))
>   File "/home/vfigueiro/dev/tg/turbogears/turbogears/controllers.py",
> line 321, in _execute_func
>     output = errorhandling.try_call(func, *args, **kw)
>   File "/home/vfigueiro/dev/tg/turbogears/turbogears/errorhandling.py",
> line 68, in try_call
>     return func(self, *args, **kw)
>   File
> "/home/vfigueiro/dev/tg/turbogears/turbogears/toolbox/catwalk/browse.py",
> line 24, in index
>     total,rows = self.rows_for_model(object_name,start,page_size,filters)
>   File
> "/home/vfigueiro/dev/tg/turbogears/turbogears/toolbox/catwalk/browse.py",
> line 126, in rows_for_model
>     rows = self.foreign_key_alias_value(object_name,rows)
>   File
> "/home/vfigueiro/dev/tg/turbogears/turbogears/toolbox/catwalk/browse.py",
> line 180, in foreign_key_alias_value
>     fk_values = self.foreign_key_query(column,alias,[x[column_name] for x
> in rows])
>   File
> "/home/vfigueiro/dev/tg/turbogears/turbogears/toolbox/catwalk/browse.py",
> line 191, in foreign_key_query
>     for id,alias in conn.queryAll(query): fk_values[str(id)] =
> self.encode_label( alias )
>   File "/usr/lib/python2.4/site-
> packages/SQLObject-0.7.1dev_r1824-py2.4.egg/sqlobject/dbconnection.py",
> line 755, in queryAll
>     return self._dbConnection._queryAll(self._connection, s)
>   File "/usr/lib/python2.4/site-
> packages/SQLObject-0.7.1dev_r1824-py2.4.egg/sqlobject/dbconnection.py",
> line 312, in _queryAll
>     self._executeRetry(conn, c, s)
>   File "/usr/lib/python2.4/site-
> packages/SQLObject-0.7.1dev_r1824-py2.4.egg/sqlobject/dbconnection.py",
> line 298, in _executeRetry
>     return cursor.execute(query)
> TypeError: argument 1 must be str, not unicode
>

> Using Postgresql (psycopg) on Suse 10 and:
>     * TurboGears 1.1a0
>     * nose 0.8.7
>     * ConfigObj 4.3.1
>     * RuleDispatch 0.5a0.dev-r2115
>     * setuptools 0.6b3
>     * FormEncode 0.5.1
>     * cElementTree 1.0.5-20051216
>     * PasteScript 0.5.1
>     * elementtree 1.2.6-20050316
>     * simplejson 1.3
>     * SQLObject 0.7.1dev-r1824
>     * CherryPy 2.2.1
>     * TurboKid 0.9.5
>     * TurboCheetah 0.9.5
>     * TurboJson 0.9.2
>     * PyProtocols 1.0a0
>     * Cheetah 1.0
>     * PasteDeploy 0.5
>     * Paste 0.5
>     * FormEncode 0.5.1
>     * kid 0.9.1
>     * Cheetah 1.0
>     * elementtree 1.2.6-20050316

New description:

 When I select the browse view in CatWalk and the selected SO has non-ascii
 titles, I get the following output:

 {{{
 2006-06-22 21:14:42,409 cherrypy.msg INFO HTTP: Page handler: <bound
 method Browse.index of <turbogears.toolbox.catwalk.browse.Browse object at
 0x40b2e72c>>
 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 index
   File "/home/vfigueiro/dev/tg/turbogears/turbogears/controllers.py", line
 280, in expose
     output = database.run_with_transaction(
   File "/home/vfigueiro/dev/tg/turbogears/turbogears/database.py", line
 221, in run_with_transaction
     retval = func(*args, **kw)
   File "<string>", line 5, in _expose
   File "/home/vfigueiro/dev/tg/turbogears/turbogears/controllers.py", line
 297, in <lambda>
     mapping, fragment, *args, **kw)))
   File "/home/vfigueiro/dev/tg/turbogears/turbogears/controllers.py", line
 321, in _execute_func
     output = errorhandling.try_call(func, *args, **kw)
   File "/home/vfigueiro/dev/tg/turbogears/turbogears/errorhandling.py",
 line 68, in try_call
     return func(self, *args, **kw)
   File
 "/home/vfigueiro/dev/tg/turbogears/turbogears/toolbox/catwalk/browse.py",
 line 24, in index
     total,rows = self.rows_for_model(object_name,start,page_size,filters)
   File
 "/home/vfigueiro/dev/tg/turbogears/turbogears/toolbox/catwalk/browse.py",
 line 126, in rows_for_model
     rows = self.foreign_key_alias_value(object_name,rows)
   File
 "/home/vfigueiro/dev/tg/turbogears/turbogears/toolbox/catwalk/browse.py",
 line 180, in foreign_key_alias_value
     fk_values = self.foreign_key_query(column,alias,[x[column_name] for x
 in rows])
   File
 "/home/vfigueiro/dev/tg/turbogears/turbogears/toolbox/catwalk/browse.py",
 line 191, in foreign_key_query
     for id,alias in conn.queryAll(query): fk_values[str(id)] =
 self.encode_label( alias )
   File "/usr/lib/python2.4/site-
 packages/SQLObject-0.7.1dev_r1824-py2.4.egg/sqlobject/dbconnection.py",
 line 755, in queryAll
     return self._dbConnection._queryAll(self._connection, s)
   File "/usr/lib/python2.4/site-
 packages/SQLObject-0.7.1dev_r1824-py2.4.egg/sqlobject/dbconnection.py",
 line 312, in _queryAll
     self._executeRetry(conn, c, s)
   File "/usr/lib/python2.4/site-
 packages/SQLObject-0.7.1dev_r1824-py2.4.egg/sqlobject/dbconnection.py",
 line 298, in _executeRetry
     return cursor.execute(query)
 TypeError: argument 1 must be str, not unicode
 }}}

 Using Postgresql (psycopg) on Suse 10 and:

     * TurboGears 1.1a0
     * nose 0.8.7
     * ConfigObj 4.3.1
     * RuleDispatch 0.5a0.dev-r2115
     * setuptools 0.6b3
     * FormEncode 0.5.1
     * cElementTree 1.0.5-20051216
     * PasteScript 0.5.1
     * elementtree 1.2.6-20050316
     * simplejson 1.3
     * SQLObject 0.7.1dev-r1824
     * CherryPy 2.2.1
     * TurboKid 0.9.5
     * TurboCheetah 0.9.5
     * TurboJson 0.9.2
     * PyProtocols 1.0a0
     * Cheetah 1.0
     * PasteDeploy 0.5
     * Paste 0.5
     * FormEncode 0.5.1
     * kid 0.9.1
     * Cheetah 1.0
     * elementtree 1.2.6-20050316

-- 
Ticket URL: <http://trac.turbogears.org/ticket/998#comment:8>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to