Skip to content

Commit 0f80b6a

Browse files
authored
Merge pull request #277 from Andi2610/develop
Changed the buffered input in python 3 to normal as it is causing issue for streaming commands
2 parents 07278fa + 7b1f43b commit 0f80b6a

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

splunklib/searchcommands/internals.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,6 @@ def read(self, ifile):
364364
name, value = None, None
365365

366366
for line in ifile:
367-
# SPL-175233 -- input is buffered, needs to be decoded
368-
if sys.version_info >= (3, 0):
369-
line = line.decode()
370-
371367
if line == '\n':
372368
break
373369
item = line.split(':', 1)

splunklib/searchcommands/search_command.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,13 +1054,8 @@ def iteritems(self):
10541054
SearchMetric = namedtuple('SearchMetric', ('elapsed_seconds', 'invocation_count', 'input_count', 'output_count'))
10551055

10561056

1057-
# SPL-175233, set default stdin to be buffered
1058-
if sys.version_info >= (3, 0) and sys.platform == 'win32':
1059-
stdinput = sys.stdin.buffer
1060-
else:
1061-
stdinput = sys.stdin
10621057

1063-
def dispatch(command_class, argv=sys.argv, input_file=stdinput, output_file=sys.stdout, module_name=None):
1058+
def dispatch(command_class, argv=sys.argv, input_file=sys.stdin, output_file=sys.stdout, module_name=None):
10641059
""" Instantiates and executes a search command class
10651060
10661061
This function implements a `conditional script stanza <https://docs.python.org/2/library/__main__.html>`_ based on the value of

0 commit comments

Comments
 (0)