Robin Dunn wrote:
Werner F. Bruhin wrote:
I am sometimes getting the following in 2.8.9.1 on Windows.
C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\masked\combobox.py:706: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if self.GetCurrentSelection() == -1 and self.GetValue().lower().strip() in self._ctrl_constraints._compareChoices:
Is this me doing something wrong or should this be changed in masked.combobox?
What is self.GetValue() and self._ctrl_constraints._compareChoices at the time the warning is issued?
I added to comobox:
print 'getvalue: %s' % str(self.GetValue().lower())
print 'compareChoices: %s' % str(self._ctrl_constraints._compareChoices)
and get this:
getvalue: find a match, for a dish - french site
compareChoices: ['vinoxml wine profiles from gws', 'wine availability search on gws', 'find a match, for a dish - french site', 'find a match, for a dish, english site', 'find a match, for a wine - french site', 'find a match, for a wine - english site']
getvalue: rosé compareChoices: ['red', 'white', 'ros\xe3\xa9', 'white moelleux', 'white mousseux', 'ros\xe3\xa9 mousseux', 'red mousseux']
The choices get loaded like this into the comobox:
def loadTypeVinsPlats(self):
sourceList = [['1', [_("Red"),]],
['2', [_("White"),]],
['3', [_("Rose"),]],
['4', [_("White Moelleux"),]],
['5', [_("White Mousseux"),]],
['6', [_("Rose Mousseux"),]],
['7', [_("Red Mousseux"),]],
]
self.typeVinsPlats.Clear()
for item in sourceList:
self.typeVinsPlats.Append(item[1][0], item)
And the source code and the charset in Poedit are set to utf-8 and "Rose" is translated to "Rosé" in gettext/Poedit.
It looks like something is going wrong when appending items?
Werner