Skip to content
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.

Ranker bug: encoding issues #101

Open
Procrat opened this issue Apr 27, 2016 · 3 comments
Open

Ranker bug: encoding issues #101

Procrat opened this issue Apr 27, 2016 · 3 comments

Comments

@Procrat
Copy link
Member

Procrat commented Apr 27, 2016

Traceback (most recent call last):
  File "/home/battlebots/production/battlebots/ranker/ranker.py", line 127, in battle_loop
    battle(loop)
  File "/home/battlebots/production/battlebots/ranker/ranker.py", line 74, in battle
    access.add_all(bots)
  File "/home/battlebots/production/battlebots/database/access.py", line 16, in add_all
    db.add_all(instances)
  File "/usr/lib/python3.4/contextlib.py", line 66, in __exit__
    next(self.gen)
  File "/home/battlebots/production/battlebots/database/__init__.py", line 23, in scoped_session
    session.commit()
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 801, in commit
    self.transaction.commit()
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 392, in commit
    self._prepare_impl()
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 372, in _prepare_impl
    self.session.flush()
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 2019, in flush
    self._flush(objects)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 2137, in _flush
    transaction.rollback(_capture_exception=True)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 184, in reraise
    raise value
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 2101, in _flush
    flush_context.execute()
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 373, in execute
    rec.execute(self)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 532, in execute
    uow
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/persistence.py", line 170, in save_obj
    mapper, table, update)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/orm/persistence.py", line 706, in _emit_update_statements
    execute(statement, multiparams)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1344, in _handle_dbapi_exception
    util.reraise(*exc_info)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 184, in reraise
    raise value
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/home/battlebots/env/lib/python3.4/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
  File "/home/battlebots/env/lib/python3.4/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "/home/battlebots/env/lib/python3.4/site-packages/pymysql/cursors.py", line 308, in _query
    conn.query(q)
  File "/home/battlebots/env/lib/python3.4/site-packages/pymysql/connections.py", line 818, in query
    sql = sql.encode(self.encoding, 'surrogateescape')
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2018' in position 480: ordinal not in range(256)
@Procrat Procrat added the bug label Apr 27, 2016
@Procrat
Copy link
Member Author

Procrat commented Apr 27, 2016

MySQL can't handle UTF-8?

@TomNaessens
Copy link
Member

TomNaessens commented Apr 27, 2016

Probably the collation of the database wrongly configured

@Procrat
Copy link
Member Author

Procrat commented Apr 27, 2016

This commit should have fixed that.

@wschella wschella added the ranker label Jul 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants