Skip to content

Commit 937414c

Browse files
authored
Merge pull request #532 from splunk/non-utf8-bugfix
non-utf8-bugfix
2 parents 8e4bc7d + 1c290d7 commit 937414c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

splunklib/modularinput/event_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def write_xml_document(self, document):
7777
7878
:param document: An ``ElementTree`` object.
7979
"""
80-
self._out.write(ensure_str(ET.tostring(document)))
80+
self._out.write(ensure_str(ET.tostring(document), errors="replace"))
8181
self._out.flush()
8282

8383
def close(self):

splunklib/searchcommands/search_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def _read_chunk(istream):
934934
except Exception as error:
935935
raise RuntimeError('Failed to read body of length {}: {}'.format(body_length, error))
936936

937-
return metadata, six.ensure_str(body)
937+
return metadata, six.ensure_str(body, errors="replace")
938938

939939
_header = re.compile(r'chunked\s+1.0\s*,\s*(\d+)\s*,\s*(\d+)\s*\n')
940940

0 commit comments

Comments
 (0)