influxdb-python icon indicating copy to clipboard operation
influxdb-python copied to clipboard

Cannot use the library with a non-ascii password

Open Gui13 opened this issue 4 years ago • 0 comments

  • InfluxDB version: 1.7.11
  • InfluxDB-python version: 5.2.0
  • Python version: Python 3.7.3 (default, Jan 22 2021, 20:04:44)
  • Operating system version: Debian Buster

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.

Gui13 avatar Oct 24 '21 07:10 Gui13