You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2012/05/16 00:25:12 UTC
[5/6] git commit: Enable piping to cqlsh with
locale.getpreferredencoding() Patch by paul cannon,
reviewd by brandonwilliams for CASSANDRA-4113
Enable piping to cqlsh with locale.getpreferredencoding()
Patch by paul cannon, reviewd by brandonwilliams for CASSANDRA-4113
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/be9fa05d
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/be9fa05d
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/be9fa05d
Branch: refs/heads/cassandra-1.1
Commit: be9fa05d06063ed84dca8f9ce6d3be5439359231
Parents: 452619c
Author: Brandon Williams <br...@apache.org>
Authored: Tue May 15 17:19:04 2012 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Tue May 15 17:19:04 2012 -0500
----------------------------------------------------------------------
bin/cqlsh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/be9fa05d/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 7a9d0a3..d3d4eb4 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -45,6 +45,7 @@ import time
import optparse
import ConfigParser
import codecs
+import locale
import re
# cqlsh should run correctly when run out of a Cassandra source tree,
@@ -408,7 +409,7 @@ class Shell(cmd.Cmd):
self.color = color
if encoding is None:
- encoding = sys.stdout.encoding
+ encoding = locale.getpreferredencoding()
self.encoding = encoding
self.output_codec = codecs.lookup(encoding)