Fix failing COPY TO STDOUT

Patch by Márton Salomváry; Reviewed by Paulo Motta for CASSANDRA-12497


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/88f36a09
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/88f36a09
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/88f36a09

Branch: refs/heads/cassandra-3.0
Commit: 88f36a0955572e13316b83e7187c76c7cd0790b6
Parents: 15e71ba
Author: Márton Salomváry <salomv...@gmail.com>
Authored: Tue Feb 7 15:15:34 2017 +0100
Committer: Paulo Motta <pa...@apache.org>
Committed: Wed Feb 22 17:12:34 2017 -0300

----------------------------------------------------------------------
 CHANGES.txt                | 1 +
 pylib/cqlshlib/copyutil.py | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/88f36a09/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 91c11fa..1a22814 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.10
+ * Fix failing COPY TO STDOUT (CASSANDRA-12497)
  * Fix ColumnCounter::countAll behaviour for reverse queries (CASSANDRA-13222)
  * Exceptions encountered calling getSeeds() breaks OTC thread 
(CASSANDRA-13018)
 Merged from 2.1:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/88f36a09/pylib/cqlshlib/copyutil.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index d22f2fe..cf5b0eb 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -83,6 +83,11 @@ def printmsg(msg, eol='\n', encoding='utf8'):
     sys.stdout.flush()
 
 
+# Keep arguments in sync with printmsg
+def swallowmsg(msg, eol='', encoding=''):
+    None
+
+
 class OneWayPipe(object):
     """
     A one way pipe protected by two process level locks, one for reading and 
one for writing.
@@ -241,7 +246,7 @@ class CopyTask(object):
 
         # do not display messages when exporting to STDOUT unless --debug is 
set
         self.printmsg = printmsg if self.fname is not None or direction == 
'from' or DEBUG \
-            else lambda _, eol='\n': None
+            else swallowmsg
         self.options = self.parse_options(opts, direction)
 
         self.num_processes = self.options.copy['numprocesses']

Reply via email to