Can't convert 'bytes' object to str implicitly
Is branch python3-port ready for Python3? I've installed the sdk based on branch python3-port.
It comes to above error when trying connect splunk deamon.
File "E:\Python3.5.1\lib\site-packages\splunk_sdk-1.5.0-py3.5.egg\splunklib\binding.py", line 1292, in read r = r + self._response.read(size)
Code:
class SplunkClient:
connection_kargs = {}
def __init__(self, host, port, username, password):
self.connection_kargs['host'] = host
self.connection_kargs['port'] = port
self.connection_kargs['username'] = username
self.connection_kargs['password'] = password
def connect(self):
return client.connect(**self.connection_kargs)
if __name__ == "__main__":
server = SplunkClient(HOST, PORT, USERNAME, PASSWORD).connect()
for app in server.apps:
print(app.name)
Looks like last commit was 2016 so my guess is that it's an abandoned experiment. I have a PR with Python 3 Support, it's only tested with the unittest suite and need more testing so if you want to do that go ahead. https://github.com/Tltx/splunk-sdk-python
@juliansxw We are reviewing #191 and will see if this is still a problem after that PR is merged.
@juliansxw I manually verified this with Python 3.5.1 locally on the develop branch (after merging #191).