mirror of https://github.com/apache/cassandra
Enable piping to cqlsh with locale.getpreferredencoding()
Patch by paul cannon, reviewd by brandonwilliams for CASSANDRA-4113
This commit is contained in:
parent
452619cd07
commit
be9fa05d06
|
|
@ -45,6 +45,7 @@ import time
|
||||||
import optparse
|
import optparse
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
import codecs
|
import codecs
|
||||||
|
import locale
|
||||||
import re
|
import re
|
||||||
|
|
||||||
# cqlsh should run correctly when run out of a Cassandra source tree,
|
# cqlsh should run correctly when run out of a Cassandra source tree,
|
||||||
|
|
@ -408,7 +409,7 @@ class Shell(cmd.Cmd):
|
||||||
|
|
||||||
self.color = color
|
self.color = color
|
||||||
if encoding is None:
|
if encoding is None:
|
||||||
encoding = sys.stdout.encoding
|
encoding = locale.getpreferredencoding()
|
||||||
self.encoding = encoding
|
self.encoding = encoding
|
||||||
self.output_codec = codecs.lookup(encoding)
|
self.output_codec = codecs.lookup(encoding)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue