Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #838 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

Traceback on identity login form submit: "TypeError: argument 1 must be str, not unicode"

Reported by: fabian Owned by: anonymous
Priority: normal Milestone: 0.9a6
Component: Identity Version: 0.9a5
Severity: normal Keywords:
Cc:

Description

Hi,

I tried to follow the IdentityManagement tutorial and get this traceback, when I try to login:

Traceback (most recent call last):
  File "/home/fabian/usr/lib/python2.4/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 103, in _run
    applyFilters('before_main')
  File "/home/fabian/usr/lib/python2.4/CherryPy-2.2.1-py2.4.egg/cherrypy/filters/__init__.py", line 151, in applyFilters
    method()
  File "/home/fabian/usr/lib/python2.4/TurboGears-0.9a5-py2.4.egg/turbogears/visit/api.py", line 154, in before_main
    plugin.record_request( visit )
  File "/home/fabian/usr/lib/python2.4/TurboGears-0.9a5-py2.4.egg/turbogears/identity/visitor.py", line 162, in record_request
    identity= self.identity_from_request(visit.key)
  File "/home/fabian/usr/lib/python2.4/TurboGears-0.9a5-py2.4.egg/turbogears/identity/visitor.py", line 86, in identity_from_request
    identity= source(visit_key)
  File "/home/fabian/usr/lib/python2.4/TurboGears-0.9a5-py2.4.egg/turbogears/identity/visitor.py", line 143, in identity_from_form
    identity= self.provider.validate_identity( user_name, pw, visit_key )
  File "/home/fabian/usr/lib/python2.4/TurboGears-0.9a5-py2.4.egg/turbogears/identity/soprovider.py", line 209, in validate_identity
    user= user_class.by_user_name( user_name )
  File "<string>", line 1, in <lambda>
  File "/home/fabian/usr/lib/python2.4/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/main.py", line 1266, in _SO_fetchAlternateID
    result, obj = cls._findAlternateID(name, dbName, value, connection)
  File "/home/fabian/usr/lib/python2.4/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/main.py", line 1262, in _findAlternateID
    value), None
  File "/home/fabian/usr/lib/python2.4/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 587, in _SO_selectOneAlt
    return self.queryOne("SELECT %s FROM %s WHERE %s = %s" %
  File "/home/fabian/usr/lib/python2.4/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 755, in queryOne
    return self._dbConnection._queryOne(self._connection, s)
  File "/home/fabian/usr/lib/python2.4/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 341, in _queryOne
    self._executeRetry(conn, c, s)
  File "/home/fabian/usr/lib/python2.4/SQLObject-0.7.1dev_r1675-py2.4.egg/sqlobject/dbconnection.py", line 297, in _executeRetry
    return cursor.execute(query)
TypeError: argument 1 must be str, not unicode

I set component to "Identity" as it is where it appears. But from the traceback one could guess that sqlobject struggles with Unicode here.

Change History

comment:1 Changed 13 years ago by godoy

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 0.9a6

This is fixed in both branch 1.0 and the trunk. This was fixed in [1354]. Also take a look at  this thread.

I'm closing this as "fixed", but if it doesn't work for you, please, reopen this bug with more information about your setup.

comment:2 Changed 13 years ago by fabian

I did some research after filing this bug (maybe the wrong order but...) and found there are well-known issues with SQLObject/Postgres/Unicode. I cannot judge if your fix is just a work-around, but it works for me :)

Thanks.

Note: See TracTickets for help on using tickets.