projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ade4f8
)
stringutils.py: tolerate sys.stdout having no 'encoding' attribute.
author
david-sarah
<david-sarah@jacaranda.org>
Sat, 26 Jun 2010 04:08:17 +0000
(21:08 -0700)
committer
david-sarah
<david-sarah@jacaranda.org>
Sat, 26 Jun 2010 04:08:17 +0000
(21:08 -0700)
src/allmydata/util/stringutils.py
patch
|
blob
|
history
diff --git
a/src/allmydata/util/stringutils.py
b/src/allmydata/util/stringutils.py
index 3e00f5d58982132645626f1a2dd152f37c1fb817..e09834044ed50ef189818b11ddea14071ebdcb7d 100644
(file)
--- 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()