From: Jeffrey C. O. <je...@ol...> - 2002-04-16 02:19:53
|
On Mon, Apr 15, 2002 at 09:31:32AM -0500, Alex Roitman wrote: > This is the traceback I get when trying to save a couple > of filters with KOI8 names: > > Traceback (most recent call last): > File "/usr/lib/python2.1/site-packages/libglade.py", line 28, in __call__ > ret = apply(self.func, a) > File "/usr/local/share/gramps/plugins/FilterEditor.py", line 83, in close_filter_editor > self.filterdb.save() > File "/usr/local/share/gramps/GenericFilter.py", line 716, in save > f.write(' <arg value="%s"/>\n' % self.fix(v)) > UnicodeError: ASCII encoding error: ordinal not in range(128) This looks to me like Python 2.1/GTK is returning Unicode strings. I'm not sure what can be done about this that won't break Python 1.5.2 compatibility. > Traceback (most recent call last): > File "/usr/lib/python2.1/site-packages/gtk.py", line 130, in __call__ > ret = apply(self.func, a) > File "/usr/local/share/gramps/gramps_main.py", line 1951, in menu_tools > task(self.database,self.active_person,self.tool_callback) > File "/usr/local/share/gramps/plugins/FilterEditor.py", line 361, in CustomFilterEditor > FilterEditor(const.custom_filters,database) > File "/usr/local/share/gramps/plugins/FilterEditor.py", line 69, in __init__ > self.draw_filters() > File "/usr/local/share/gramps/plugins/FilterEditor.py", line 93, in draw_filters > self.filter_list.append([f.get_name(),f.get_comment()]) > File "/usr/lib/python2.1/site-packages/gtk.py", line 1229, in append > return _gtk.gtk_clist_append(self._o, values) > TypeError: sequence item not a string I'm wondering if this isn't another case of a difference between Python 2.1 and Python 1.5.2 - I'm unable to duplicate the problem on Python 1.5.2 and I don't have a Python 2.X installation that's capable of running GRAMPS. Can you try this patch and see if this improves things? I suspect that newer versions of the XML code in Python is setting an attribute to be 'None' when in 1.5.2 you don't. Index: src/GenericFilter.py =================================================================== RCS file: /cvsroot/gramps/gramps/src/GenericFilter.py,v retrieving revision 1.7 diff -u -r1.7 GenericFilter.py --- src/GenericFilter.py 14 Apr 2002 14:56:26 -0000 1.7 +++ src/GenericFilter.py 16 Apr 2002 01:39:50 -0000 @@ -751,7 +751,7 @@ except ValueError: op = attrs['function'] self.f.set_logical_op(op) - if attrs.has_key('comment'): + if attrs.has_key('comment') and attrs['comment']: self.f.set_comment(attrs['comment']) if attrs.has_key('invert'): try: Jeff ----- End forwarded message ----- |