[
https://issues.apache.org/jira/browse/CASSANDRA-11626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15264620#comment-15264620
]
Tyler Hobbs commented on CASSANDRA-11626:
-----------------------------------------
In a few places in cqlsh we were only handling ascii chars in error messages.
I've changed this to use the specified encoding (defaults to UTF-8).
Branches and pending CI runs (merges from 2.2 up are trivial and can be
ignored):
||branch||dtest||
|[CASSANDRA-11626-2.2|https://github.com/thobbs/cassandra/tree/CASSANDRA-11626-2.2]|[dtest|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-11626-2.2-dtest]|
|[CASSANDRA-11626-3.0|https://github.com/thobbs/cassandra/tree/CASSANDRA-11626-3.0]|[dtest|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-11626-3.0-dtest]|
|[CASSANDRA-11626-trunk|https://github.com/thobbs/cassandra/tree/CASSANDRA-11626-trunk]|[dtest|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-11626-trunk-dtest]|
I've also opened a [dtest pull
request|https://github.com/riptano/cassandra-dtest/pull/965] that covers a
couple of the unicode error message scenarios.
> cqlsh fails and exits on non-ascii chars
> ----------------------------------------
>
> Key: CASSANDRA-11626
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11626
> Project: Cassandra
> Issue Type: Bug
> Components: Tools
> Reporter: Robert Stupp
> Assignee: Tyler Hobbs
> Priority: Minor
> Labels: cqlsh
> Fix For: 2.2.x, 3.0.x, 3.x
>
>
> Just seen on cqlsh on current trunk:
> To repro, copy {{ä}} (german umlaut) to cqlsh and press return.
> cqlsh errors out and immediately exits.
> {code}
> $ bin/cqlsh
> Connected to Test Cluster at 127.0.0.1:9042.
> [cqlsh 5.0.1 | Cassandra 2.1.13-SNAPSHOT | CQL spec 3.2.1 | Native protocol
> v3]
> Use HELP for help.
> cqlsh> ä
> Invalid syntax at line 1, char 1
> Traceback (most recent call last):
> File "/Users/snazy/devel/cassandra/trunk/bin/cqlsh.py", line 2636, in
> <module>
> main(*read_options(sys.argv[1:], os.environ))
> File "/Users/snazy/devel/cassandra/trunk/bin/cqlsh.py", line 2625, in main
> shell.cmdloop()
> File "/Users/snazy/devel/cassandra/trunk/bin/cqlsh.py", line 1114, in
> cmdloop
> if self.onecmd(self.statement.getvalue()):
> File "/Users/snazy/devel/cassandra/trunk/bin/cqlsh.py", line 1139, in onecmd
> self.printerr(' %s' % statementline)
> File "/Users/snazy/devel/cassandra/trunk/bin/cqlsh.py", line 2314, in
> printerr
> self.writeresult(text, color, newline=newline, out=sys.stderr)
> File "/Users/snazy/devel/cassandra/trunk/bin/cqlsh.py", line 2303, in
> writeresult
> out.write(self.applycolor(str(text), color) + ('\n' if newline else ''))
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position
> 2: ordinal not in range(128)
> $
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)