From 6ff83e6f29217c4110b8b7365a04f3cab75fac65 Mon Sep 17 00:00:00 2001 From: "Bhargav Joshi(C)" Date: Fri, 19 Jul 2019 00:29:07 +0530 Subject: [PATCH 1/2] csv.Dialect converted to str for python3 --- splunklib/searchcommands/validators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/splunklib/searchcommands/validators.py b/splunklib/searchcommands/validators.py index dca4cf422..f3e2e5213 100644 --- a/splunklib/searchcommands/validators.py +++ b/splunklib/searchcommands/validators.py @@ -249,10 +249,10 @@ class List(Validator): class Dialect(csv.Dialect): """ Describes the properties of list option values. """ strict = True - delimiter = b',' - quotechar = b'"' + delimiter = str(',') + quotechar = str('"') doublequote = True - lineterminator = b'\n' + lineterminator = str('\n') skipinitialspace = True quoting = csv.QUOTE_MINIMAL From 6b151c3159d120ab9e8a04e8b5c883bc7129ae52 Mon Sep 17 00:00:00 2001 From: Bhargav Joshi Date: Mon, 30 Sep 2019 16:34:41 +0530 Subject: [PATCH 2/2] Pull request for DVPL-7639 to treat the integer and long variables same in both python versions --- splunklib/searchcommands/internals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/splunklib/searchcommands/internals.py b/splunklib/searchcommands/internals.py index 02634c081..45d20ad48 100644 --- a/splunklib/searchcommands/internals.py +++ b/splunklib/searchcommands/internals.py @@ -580,7 +580,7 @@ def _write_record(self, record): value = str(value.real) elif value_t is six.text_type: value = value - elif value_t is int or value_t is int or value_t is float or value_t is complex: + elif isinstance(value, six.integer_types) or value_t is float or value_t is complex: value = str(value) elif issubclass(value_t, (dict, list, tuple)): value = str(''.join(RecordWriter._iterencode_json(value, 0))) @@ -610,7 +610,7 @@ def _write_record(self, record): values += (value, None) continue - if value_t is int or value_t is int or value_t is float or value_t is complex: + if isinstance(value, six.integer_types) or value_t is float or value_t is complex: values += (str(value), None) continue