Skip to content

Commit 8a40047

Browse files
author
bj8798
authored
Merge pull request #2 from splunk/develop
Merge Develop
2 parents 6b151c3 + e168d65 commit 8a40047

File tree

8 files changed

+39
-10
lines changed

8 files changed

+39
-10
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Splunk SDK for Python Changelog
22

3+
## Version 1.6.9
4+
5+
### Bug Fix
6+
7+
* Fix buffered input in python 3
8+
9+
## Version 1.6.8
10+
11+
### Bug Fix
12+
13+
* Fix custom search command on python 3 on windows
14+
15+
## Version 1.6.7
16+
17+
### Changes
18+
19+
* Updated the Splunk SDK for Python to work with the Python 3 version of Splunk Enterprise on Windows
20+
* Improved the performance of deleting/updating an input
21+
* Added logging to custom search commands app to showcase how to do logging in custom search commands by using the Splunk SDK for Python
22+
323
## Version 1.6.6
424

525
### Bug fixes

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# The Splunk Software Development Kit for Python
55

6-
#### Version 1.6.6
6+
#### Version 1.6.8
77

88
The Splunk Software Development Kit (SDK) for Python contains library code and
99
examples designed to enable developers to build applications using Splunk.
@@ -294,8 +294,6 @@ If you would like to contribute to the SDK, go here for more information:
294294
<li><a href='http://splunk-base.splunk.com/answers/'>Splunk Answers</a> (use
295295
the <b>sdk</b>, <b>java</b>, <b>python</b>, and <b>javascript</b> tags to
296296
identify your questions)</li>
297-
<li><a href='http://groups.google.com/group/splunkdev'>Splunkdev Google
298-
Group</a></li>
299297
</ul>
300298
3. Splunk will NOT provide support for SDKs if the core library (the
301299
code in the <b>/splunklib</b> directory) has been modified. If you modify an

examples/searchcommands_app/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def run(self):
439439
setup(
440440
description='Custom Search Command examples',
441441
name=os.path.basename(project_dir),
442-
version='1.6.6',
442+
version='1.6.9',
443443
author='Splunk, Inc.',
444444
author_email='devinfo@splunk.com',
445445
url='http://github.com/splunk/splunk-sdk-python',

splunklib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
from __future__ import absolute_import
1818
from splunklib.six.moves import map
19-
__version_info__ = (1, 6, 6)
19+
__version_info__ = (1, 6, 9)
2020
__version__ = ".".join(map(str, __version_info__))

splunklib/binding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ def request(url, message, **kwargs):
13691369
head = {
13701370
"Content-Length": str(len(body)),
13711371
"Host": host,
1372-
"User-Agent": "splunk-sdk-python/1.6.6",
1372+
"User-Agent": "splunk-sdk-python/1.6.9",
13731373
"Accept": "*/*",
13741374
"Connection": "Close",
13751375
} # defaults

splunklib/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3576,7 +3576,7 @@ class KVStoreCollection(Entity):
35763576
def data(self):
35773577
"""Returns data object for this Collection.
35783578
3579-
:rtype: :class:`KVStoreData`
3579+
:rtype: :class:`KVStoreCollectionData`
35803580
"""
35813581
return KVStoreCollectionData(self)
35823582

splunklib/searchcommands/internals.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939

4040
csv.field_size_limit(10485760) # The default value is 128KB; upping to 10MB. See SPL-12117 for background on this issue
4141

42-
if sys.platform == 'win32':
42+
# SPL-175233 -- python3 stdout is already binary
43+
if sys.platform == 'win32' and sys.version_info <= (3, 0):
4344
# Work around the fact that on Windows '\n' is mapped to '\r\n'. The typical solution is to simply open files in
4445
# binary mode, but stdout is already open, thus this hack. 'CPython' and 'PyPy' work differently. We assume that
4546
# all other Python implementations are compatible with 'CPython'. This might or might not be a valid assumption.
@@ -339,6 +340,8 @@ class CsvDialect(csv.Dialect):
339340
doublequote = True
340341
skipinitialspace = False
341342
lineterminator = '\r\n'
343+
if sys.version_info >= (3, 0) and sys.platform == 'win32':
344+
lineterminator = '\n'
342345
quoting = csv.QUOTE_MINIMAL
343346

344347

@@ -658,6 +661,13 @@ class RecordWriterV1(RecordWriter):
658661

659662
def flush(self, finished=None, partial=None):
660663

664+
# SPL-175233
665+
def writeEOL():
666+
if sys.version_info >= (3, 0) and sys.platform == 'win32':
667+
write('\n')
668+
else:
669+
write('\r\n')
670+
661671
RecordWriter.flush(self, finished, partial) # validates arguments and the state of this instance
662672

663673
if self._record_count > 0 or (self._chunk_count == 0 and 'messages' in self._inspector):
@@ -678,9 +688,9 @@ def flush(self, finished=None, partial=None):
678688
write(message_level(level, level))
679689
write('=')
680690
write(text)
681-
write('\r\n')
691+
writeEOL()
682692

683-
write('\r\n')
693+
writeEOL()
684694

685695
elif messages is not None:
686696

splunklib/searchcommands/search_command.py

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

10561056

1057+
10571058
def dispatch(command_class, argv=sys.argv, input_file=sys.stdin, output_file=sys.stdout, module_name=None):
10581059
""" Instantiates and executes a search command class
10591060

0 commit comments

Comments
 (0)