Checking if a path exists before pointing locale there seems like a good thing to me.

The has_key has changed because it is not present in python 3.
I locally have many more changes I hope to commit tomorrow for python 3 support.


2012/11/14 Paul Franklin <>
As there have been several recent threads concerning LANG
and internationalization let me ask another question.

Besides those of you who run gramps in other languages (which
I don't) I would especially appreciate the comments of people
who know about other architectures (Windows, Mac, etc.), as
I won't make any change which won't work there too.

A recent (3.4.2) bug had to do with this topic/problem and
a patch has been proposed to handle it, in
which in essence is:

-if "GRAMPSI18N" in os.environ:
-    LOCALEDIR = os.environ["GRAMPSI18N"]
+if os.environ.has_key('GRAMPSI18N'):
+    if os.path.exists(os.environ['GRAMPSI18N']):
+        LOCALEDIR = os.environ['GRAMPSI18N']
+    else:
+        LOCALEDIR = None

and of course I am not giving the whole context (there
are more branches in the "if" for instance, but they are
not changed by the patch), and we can ignore the
"has_key" line, whose syntax won't need changing.

So the patch seems pretty safe to me.  It does what
the original code did and adds another layer of testing,
to see if the directory actually exists before using it.

But as I said I am very unfamiliar with the whole gramps
translation process and I'd feel a lot happier if people
who do understand it said the patch would do no harm.


Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
Gramps-devel mailing list