Skip to content

Commit 09c2e09

Browse files
author
David Noble
committed
Hack to get past Windows issue
Splunk opens stdin/stdout in text mode on Windows causing line ending problems. This change works around one such problem. We may have others. We'll see.
1 parent 03c171a commit 09c2e09

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

splunklib/searchcommands/search_command_internals.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# under the License.
1414

1515
import collections
16+
import os
1617
import re
1718
import urllib2 as urllib
1819

@@ -169,8 +170,9 @@ def write(self, output_file):
169170
# for level, message in self:
170171
# output_file.write('%s=%s\r\n' % (level, message))
171172
self
172-
output_file.write('\r\n')
173+
output_file.write(MessagesHeader.line_ending)
173174

175+
line_ending = '\n' if os.name == 'nt' else '\r\n'
174176

175177
class SearchCommandParser(object):
176178
""" Parses the arguments to a search command

0 commit comments

Comments
 (0)