Crash trying to search on Windows
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.