-
Notifications
You must be signed in to change notification settings - Fork 380
Closed
Description
When attempting to use the API, I would receive the following error with python2.6 and 2.7
Traceback (most recent call last):
File "examples/search.py", line 115, in <module>
main(sys.argv[1:])
File "examples/search.py", line 72, in main
service = client.connect(**kwargs_splunk)
File "examples/../splunklib/client.py", line 321, in connect
s.login()
File "examples/../splunklib/binding.py", line 852, in login
session = XML(body).findtext("./sessionKey")
File "/usr/lib/python2.6/xml/etree/ElementTree.py", line 964, in XML
return parser.close()
File "/usr/lib/python2.6/xml/etree/ElementTree.py", line 1254, in close
self._parser.Parse("", 1) # end of data
xml.parsers.expat.ExpatError: no element found: line 1, column 0
I discovered that the cause of this issue was https://github.com/splunk/splunk-sdk-python/blob/master/splunklib/binding.py#L1341. When the HTTPConnection object is closed, so is the HTTPResponse object, causing read() to return an empty string. Removing this line fixed the problem.
I'm unsure of why this issue is affecting me and seemingly nobody else.
Metadata
Metadata
Assignees
Labels
No labels