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.
1 parent 8874404 commit 9613e43Copy full SHA for 9613e43
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
@@ -77,8 +78,10 @@ def load(text, match=None):
77
78
'names': {}
79
}
80
- if isinstance(text, unicode):
81
- text = text.encode('utf-8')
+ # Convert to unicode encoding in only python 2 for xml parser
82
+ if sys.version_info < (3, 0, 0):
83
+ if isinstance(text, unicode):
84
+ text = text.encode('utf-8')
85
86
root = XML(text)
87
items = [root] if match is None else root.findall(match)
0 commit comments