Skip to content

Commit 5a0c84a

Browse files
committed
Fix XML responses to not throw errors for unicode characters
Changed `splunklib/data.py` `load` function to convert text provided into a utf-8 string so that Python XML parser will not throw errors when processing utf-8 encoded responses.
1 parent f96b8ad commit 5a0c84a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

splunklib/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def load(text, match=None):
7676
'namespaces': [],
7777
'names': {}
7878
}
79-
root = XML(text)
79+
root = XML(text.encode('utf-8'))
8080
items = [root] if match is None else root.findall(match)
8181
count = len(items)
8282
if count == 0:

0 commit comments

Comments
 (0)