Issue 3468

Title
Crash trying to search on Windows
Priority
bug
Status
closed
Superseder
client_3.0 on windows: utf8 codec can't decode when entering a letter in Filter Field (German DB) (issue 3440)
Nosy list
albertca, ced
Assigned to
Keywords

Created on 2013-11-04.13:12:05 by albertca, last changed 110 months ago by ced.

Messages

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2013-11-04.14:21:04
Duplicate issue3440
Author: [hidden] (albertca)
Date: 2013-11-04.13:12:04
Using latest revision (3.0 branch) of Tryton client on Windows crashes when trying 
to search (just typing a single character). For example, going to 
Administration/Models/Models and typing the letter "D" gives the following backtrace 
(using Catalan language):

  File "C:\tryton\tryton\tryton\gui\window\view_form\view\screen_container.py", line 
271, in update
    res = self.screen.search_complete(self.get_text())

  File "C:\tryton\tryton\tryton\gui\window\view_form\screen\screen.py", line 180, in 
search_complete
    return list(self.domain_parser.completion(search_string))

  File "C:\tryton\tryton\tryton\common\domain_parser.py", line 844, in completion
    for complete in self.complete(ending):

  File "C:\tryton\tryton\tryton\common\domain_parser.py", line 880, in complete
    if field['string'].lower().startswith(name.lower()):

It seems that in some cases field['string'] is of type str and in other cases it is 
unicode. I did a quick patch like this:

if not isinstance(field['string'], unicode):
    field_string = unicode(field['string'], 'utf-8')

and using field_string instead of field['string'] avoids the crash but it doesn't 
look like the right solution to me.
History
Date User Action Args
2013-11-04 14:21:05cedsetstatus: unread -> closed
messages: + msg14531
superseder: + client_3.0 on windows: utf8 codec can't decode when entering a letter in Filter Field (German DB)
nosy: + ced
2013-11-04 13:12:05albertcacreate

Showing 10 items. Show all history (warning: this could be VERY long)