influxdata / influxdb-python

Python client for InfluxDB
MIT License
1.7k stars 522 forks source link

Cannot use the library with a non-ascii password #903

Open Gui13 opened 3 years ago

Gui13 commented 3 years ago

I have an user that has a non-ascii char in its password.

Using the influxdb command line, I can auth without issues:

image

But from the python3 module:

debian@server2:~$ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import influxdb
>>> client = influxdb.InfluxDBClient(username="gui13", password="xxxéxxx")
>>> client.query("show databases")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/influxdb/client.py", line 416, in query
    expected_response_code=expected_response_code
  File "/usr/lib/python3/dist-packages/influxdb/client.py", line 286, in request
    raise InfluxDBClientError(response.content, response.status_code)
influxdb.exceptions.InfluxDBClientError: 401: {"error":"authorization failed"}

>>>

Using a password without accents (é) works.