We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f96b8ad + e10e50d commit 05f789cCopy full SHA for 05f789c
splunklib/data.py
@@ -17,6 +17,7 @@
17
"""
18
19
from __future__ import absolute_import
20
+import sys
21
from xml.etree.ElementTree import XML
22
from splunklib import six
23
@@ -76,6 +77,11 @@ def load(text, match=None):
76
77
'namespaces': [],
78
'names': {}
79
}
80
+
81
+ # Convert to unicode encoding in only python 2 for xml parser
82
+ if(sys.version_info < (3, 0, 0) and isinstance(text, unicode)):
83
+ text = text.encode('utf-8')
84
85
root = XML(text)
86
items = [root] if match is None else root.findall(match)
87
count = len(items)
0 commit comments