On Wed, 2006-04-05 at 19:08 +1000, Graham Williams wrote: > This is curious. What version of python?
I have exact same version of python2.3 as you do.
> I get:
>
> $ python2.3
> Python 2.3.5 (#2, Mar 6 2006, 10:12:24)
> [GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import gtkspell
> >>> import gtk
> >>> gtkspell.Spell(gtk.TextView()).set_language(None)
> >>>
> TypeError: argument 1 must be string, not None
OK, I added catching this exception as well. Here's the patch
against the 2.0.10 release. If you could apply it and tell me
how this works for you it would be great!
> It is almost as if there is an exception but it's capture is delayed.
> I've just deleted that line in the code for now and Gramps is
> working. Hope it won't affect anything.
Yes. So the new code should both detect None explicitly and catch
the TypeError exception (in case something else is passed to
set_language() other than string).
Thanks,
Alex
============
diff -u -r1.1.2.7 -r1.1.2.9
--- src/Spell.py 15 Oct 2005 04:29:19 -0000 1.1.2.7
+++ src/Spell.py 5 Apr 2006 16:56:02 -0000 1.1.2.9
@@ -46,11 +46,16 @@
import locale
lang = locale.getlocale()[0]
- gtkspell.Spell(gtk.TextView()).set_language(lang)
- success = True
-
+ if lang == None:
+ print _("Spelling checker cannot be used without language
set.")
+ print _("Set your locale appropriately to use spelling
checker.")
+ else:
+ gtkspell.Spell(gtk.TextView()).set_language(lang)
+ success = True
except ImportError, msg:
print _("Spelling checker is not installed")
+except TypeError,msg:
+ print "Spell.py: ", msg
except RuntimeError,msg:
print "Spell.py: ", msg
except SystemError,msg:
============
--
Alexander Roitman http://www.gramps-project.org
signature.asc
Description: This is a digitally signed message part

