From 5dc89962babaae780da810f1ed0eb0595c6fc36b Mon Sep 17 00:00:00 2001 From: John Ralls Date: Fri, 5 Apr 2013 23:54:58 +0000 Subject: [PATCH] [r21899]GrampsLocale: Ensure self.encoding exists before testing it svn: r21901 --- gramps/gen/utils/grampslocale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index 939a60395..018fab1e9 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -347,7 +347,7 @@ class GrampsLocale(object): #Next, we need to know what is the encoding from the native #environment. This is used by python standard library funcions which #localize their output, e.g. time.strftime(): - if not self.encoding: + if not (hasattr(self, 'encoding') and self.encoding): self.encoding = (locale.getpreferredencoding() or sys.getdefaultencoding()) #Ensure that output is encoded correctly to stdout and stderr. This is