psycopg2cffi can't ascii encode character sql_contrain
With psycopg2cffi installed (v2.7.5), can't 'ascii' codec when check sql_constrain (and _sql_error_messages?).
The traceback:
12071 140328623490816 [2016-12-20 06:38:33,119] ERROR trytond.protocols.dispatcher .create(*([{u'kind': u'receivable', u'childs': [], u'name': u'ddd', u'different_party_reconcile': False, u'company': 1, u'taxes': [], u'note': u'', u'active': True, u'code': u'', u'deferral': True, u'general_ledger_balance': False, u'second_currency': None, u'party_required': False, u'type': 1, u'reconcile': False}], {u'date_format': u'%x', u'language': None, u'groups': [12, 1, 11, 6, 18, 14, 8, 3, 4, 5, 7, 21, 2, 17, 19, 13, 10, 15, 9, 16, 22, 20], u'employee': None, u'language_direction': u'ltr', u'company': 1, u'company.rec_name': u'cc', '_check_access': True}), **{}) from admin@185.73.168.17//xxx/
Traceback (most recent call last):
File "/home/xxx/tryton/trytond/trytond/protocols/dispatcher.py", line 160, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/home/xxx/tryton/trytond/trytond/modules/account_parent_code/account.py", line 98, in create
accounts = super(Account, cls).create(vlist)
File "/home/xxx/tryton/trytond/trytond/model/modelsql.py", line 558, in create
exception, values, transaction=transaction)
File "/home/xxx/tryton/trytond/trytond/model/modelsql.py", line 307, in __raise_integrity_error
if name in str(exception):
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 31: ordinal not in range(128)
I check this line [1] and the type is:
Detected in 4.2
[1] https://bitbucket.org/tryton/trytond/src/dd969de519a84a6b3062701a190da1e4ffb3c974/trytond/model/modelsql.py?at=4.2&fileviewer=file-view-default#modelsql.py-306