openstreetmap / trac-tickets

Archived Trac Tickets
1 stars 1 forks source link

trac.openstreetmap.org auth issues for users with unicode characters in their OSM username #5493

Open openstreetmap-trac opened 3 years ago

openstreetmap-trac commented 3 years ago

Reporter: donal.hunt[at]gmail.com [Submitted to the original trac issue database at 9.52am, Tuesday, 22nd May 2018]

Example username: dnal URL: https://trac.openstreetmap.org/login

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/trac/web/api.py", line 514, in send_error
    data, 'text/html')
  File "/usr/lib/python2.7/dist-packages/trac/web/chrome.py", line 968, in render_template
    message = Markup(req.session.pop('chrome.%s.%d'
  File "/usr/lib/python2.7/dist-packages/trac/web/api.py", line 316, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.7/dist-packages/trac/web/main.py", line 268, in _get_session
    return Session(self.env, req)
  File "/usr/lib/python2.7/dist-packages/trac/web/session.py", line 210, in __init__
    self.promote_session(sid)
  File "/usr/lib/python2.7/dist-packages/trac/web/session.py", line 269, in promote_session
    (sid, self.req.authname))]
  File "/usr/lib/python2.7/dist-packages/trac/db/util.py", line 121, in execute
    cursor.execute(query, params)
  File "/usr/lib/python2.7/dist-packages/trac/db/util.py", line 65, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line 78, in execute
    result = PyFormatCursor.execute(self, *args)
  File "/usr/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line 56, in execute
    args or [])
  File "/usr/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
    return function(self, *args, **kwargs)
ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings

It looks like openstreetmap is using a very old version of TRAC so this may be fixed in a newer version.