Use pickle protocol 0 and use lambda for sorted key to avoid unicode problem for str.lower

This commit is contained in:
Terje Skjaeveland 2014-06-17 21:02:14 +02:00
parent 30617fda05
commit 9b3f2bbe80
2 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ class GestureDatabase(GridLayout):
self.selected_count = 0
self.ids.gesture_list.clear_widgets()
for k in sorted(self.gdict, key=str.lower):
for k in sorted(self.gdict, key=lambda n: n.lower()):
gitem = GestureDatabaseItem(name=k, gesture_list=self.gdict[k])
gitem.bind(on_select=self.select_item)
gitem.bind(on_deselect=self.deselect_item)

View File

@ -390,7 +390,7 @@ class Recognizer(EventDispatcher):
This method accepts optional :meth:`Recognizer.filter` arguments.
'''
io = BytesIO()
p = pickle.Pickler(io)
p = pickle.Pickler(io, protocol=0)
multistrokes = []
defaults = {'priority': 100, 'numpoints': 16, 'stroke_sens': True,
'orientation_sens': False, 'angle_similarity': 30.0}