From 3aaae7aa59f3a08a657f4e7c93c848864117378f Mon Sep 17 00:00:00 2001 From: Matthieu Nantern Date: Tue, 29 Dec 2015 10:15:14 +0100 Subject: [PATCH] (cqlsh) encode input correctly when saving history patch by matthieu.nantern; reviewed by pauloricardomg for CASSANDRA-10948 --- CHANGES.txt | 1 + bin/cqlsh.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 1a92fd6a0d..37a0137dc8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -23,6 +23,7 @@ * Better handling of SSL connection errors inter-node (CASSANDRA-10816) * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) + * (cqlsh) encode input correctly when saving history Merged from 2.1: * Fix bad gossip generation seen in long-running clusters (CASSANDRA-10969) * Avoid NPE when incremental repair fails (CASSANDRA-10909) diff --git a/bin/cqlsh.py b/bin/cqlsh.py index c03a3c2fda..17c42a6923 100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@ -1123,7 +1123,7 @@ class Shell(cmd.Cmd): new_hist = srcstr.replace("\n", " ").rstrip() if nl_count > 1 and self.last_hist != new_hist: - readline.add_history(new_hist) + readline.add_history(new_hist.encode(self.encoding)) self.last_hist = new_hist cmdword = tokens[0][1]