charles-001 / dolphie

Your single pane of glass for real-time analytics into MySQL/MariaDB & ProxySQL
https://pypi.org/project/dolphie/
GNU General Public License v3.0
589 stars 36 forks source link

invalid character in password when using config file #67

Closed loesophage closed 2 weeks ago

loesophage commented 2 weeks ago

Hello there, and first thanx for this tool i met this issue using a password with % in it

$ dolphie -c ./.config.cnf
Traceback (most recent call last):
  File "/usr/local/bin/dolphie", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/dolphie/app.py", line 2221, in main
    arg_parser = ArgumentParser(__version__)
  File "/usr/local/lib/python3.10/dist-packages/dolphie/Modules/ArgumentParser.py", line 140, in __init__
    self._parse()
  File "/usr/local/lib/python3.10/dist-packages/dolphie/Modules/ArgumentParser.py", line 486, in _parse
    host = cfg.get(hostgroup, key).strip()
  File "/usr/lib/python3.10/configparser.py", line 801, in get
    return self._interpolation.before_get(self, section, option, value,
  File "/usr/lib/python3.10/configparser.py", line 396, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib/python3.10/configparser.py", line 443, in _interpolate_some
    raise InterpolationSyntaxError(
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%@D8z"' 

i think it should be related to the configParser interpolation mode which is in basic mode i guess.

rgds

charles-001 commented 2 weeks ago

Hi @loesophage - thanks for reporting this! Can you clone the main branch and then run poetry install then poetry run dolphie to test my fix? If all looks good, I'll release a new version.

loesophage commented 2 weeks ago

Hello @charles-001 Sorry for the delay, i was using the wrong poetry installation It seems to work fine now. Thanks

charles-001 commented 2 weeks ago

Awesome! Thanks again for reporting