Page MenuHomePhabricator

Non-latin characters in username causing error
Open, MediumPublic

Description

Here's the error message, I am facing because my username is non-latin.

Oops! Something went wrong.


Error:
'latin-1' codec can't encode characters in position 0-12: ordinal not in range(256)
Traceback (most recent call last):
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/data/project/oabot/www/python/src/app.py", line 139, in review_one_edit
nb_edits = UserStats.get('en', username).nb_edits
File "./userstats.py", line 76, in get
instance = session.query(cls).filter_by(wiki=wiki, user_name=user).first()
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2755, in first
ret = list(self[0:1])
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2547, in getitem
return list(res)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2855, in iter
return self._execute_and_instances(context)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2878, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
return meth(self, multiparams, params)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1053, in _execute_clauseelement
compiled_sql, distilled_params
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1189, in _execute_context
context)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1405, in _handle_dbapi_exception
util.reraise(*exc_info)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
context)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
cursor.execute(statement, parameters)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 187, in execute
query = query % tuple([db.literal(item) for item in args])
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 278, in literal
return self.escape(o, self.encoders)
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 208, in unicode_literal
return db.literal(u.encode(unicode_literal.charset))

Event Timeline

Ocaasi_WMF triaged this task as Medium priority.Oct 25 2017, 7:23 PM
Ocaasi_WMF created this task.

I still see only Latin script usernames in https://tools.wmflabs.org/oabot/stats but I've not tested.