Category does not play well with Umlaut

Bug #1095338 reported by simpsus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
avernus
Fix Released
Medium
wolfer

Bug Description

When a rule contains an umlaut, the preview works fine. The close button saves the dialog without hassle.
The dialog cannot be opened again:

Traceback (most recent call last):
  File "/home/bastian/workspace/avernus/avernus/gui/mainwindow.py", line 171, in on_categorization_rules
    CategorizationRulesDialog(parent=self.window)
  File "/home/bastian/workspace/avernus/avernus/gui/account/categorization_dialog.py", line 27, in __init__
    self._init_tree()
  File "/home/bastian/workspace/avernus/avernus/gui/account/categorization_dialog.py", line 53, in _init_tree
    for rule in categorization_controller.get_all_rules():
  File "/home/bastian/workspace/avernus/avernus/controller/categorization_controller.py", line 12, in get_all_rules
    return objects.session.query(CategoryFilter).all()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2115, in all
    return list(self)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2226, in __iter__
    self.session._autoflush()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1120, in _autoflush
    self.flush()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1718, in flush
    self._flush(objects)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1789, in _flush
    flush_context.execute()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 331, in execute
    rec.execute(self)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 475, in execute
    uow
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 59, in save_obj
    mapper, table, update)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 485, in _emit_update_statements
    execute(statement, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1449, in execute
    params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1584, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 331, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (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. u'UPDATE category_filter SET rule=?, category_id=? WHERE category_filter.id = ?' ('Geb\xc3\xbchrenerstattung', 5, 1)

and closing the programm brings up

Traceback (most recent call last):
  File "/home/bastian/workspace/avernus/avernus/gui/mainwindow.py", line 124, in on_destroy
    objects.session.commit()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 703, in commit
    self.transaction.commit()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 361, in commit
    self._prepare_impl()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 327, in _prepare_impl
    self._assert_is_active()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 213, in _assert_is_active
    % self._rollback_exception
sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (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. u'UPDATE category_filter SET rule=?, category_id=? WHERE category_filter.id = ?' ('Geb\xc3\xbchrenerstattung', 5, 1)

with the result that no rule has been saved in the session where there was an umlaut

Revision history for this message
wolfer (wolfer7) wrote :

using umlauts for portfolio names results in crashes too

wolfer (wolfer7)
Changed in avernus:
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → wolfer (wolfer7)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.