From: david-sarah <david-sarah@jacaranda.org>
Date: Sat, 26 Jun 2010 04:08:17 +0000 (-0700)
Subject: stringutils.py: tolerate sys.stdout having no 'encoding' attribute.
X-Git-Url: https://git.rkrishnan.org/%5B/frontends/$rel_link?a=commitdiff_plain;h=b8df25a8d1b63da19ce94705155dea87e4d927ae;p=tahoe-lafs%2Ftahoe-lafs.git

stringutils.py: tolerate sys.stdout having no 'encoding' attribute.
---

diff --git a/src/allmydata/util/stringutils.py b/src/allmydata/util/stringutils.py
index 3e00f5d5..e0983404 100644
--- a/src/allmydata/util/stringutils.py
+++ b/src/allmydata/util/stringutils.py
@@ -41,7 +41,9 @@ def _reload():
 
     filesystem_encoding = _canonical_encoding(sys.getfilesystemencoding())
 
-    outenc = sys.stdout.encoding
+    outenc = None
+    if hasattr(sys.stdout, 'encoding'):
+        outenc = sys.stdout.encoding
     if outenc is None:
         try:
             outenc = locale.getpreferredencoding()