[New-bugs-announce] [issue41799] splunklib.client does not handle Unicode characters

Jay Patel report at bugs.python.org
Wed Sep 16 14:09:57 EDT 2020


New submission from Jay Patel <jay.patel at crestdatasys.com>:

Using splunklib.client module to use Pythonic interface to the Splunk REST API. I am using the connect method of the module to connect and log in to a Splunk instance.

Code:
import splunklib.client as splunk_client
kwargs_config_flags = {
                'host': "test_instance漢字",
                'port': 8089,
                'username': <username>,
                'password': <password>,
                'owner': None,
                'app': None}
sc = splunk_client.connect(**kwargs_config_flags)

For python 3
Output:
''latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)'

I tried to encode the host to utf-8, "test_instance漢字".encode("utf-8")
Output:
'a bytes-like object is required, not 'str''

For python 2
It is working as expected.
output: 'nodename nor servname provided, or not known'

Is there a way by which this can be handled at the module level?

----------
components: Unicode
messages: 377005
nosy: ezio.melotti, jpatel, vstinner
priority: normal
severity: normal
status: open
title: splunklib.client does not handle Unicode characters
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41799>
_______________________________________


More information about the New-bugs-announce mailing list