darkphoenix / tolino-calibre-sync

Access to tolino cloud with Python 3 and Calibre
GNU Lesser General Public License v2.1
52 stars 6 forks source link

Handle special characters in password #1

Closed thorian93 closed 2 years ago

thorian93 commented 3 years ago

I would like to avoid giving my password on the command line when using ./tolinoclient.py and put it into the .tolinoclientrc.

Sadly I get the following error:

Traceback (most recent call last):
  File "/home/robin/Downloads/tolino-calibre-sync/./tolinoclient.py", line 136, in <module>
    defaults = dict(c.items('Defaults'))
  File "/usr/lib64/python3.9/configparser.py", line 859, in items
    return [(option, value_getter(option)) for option in orig_keys]
  File "/usr/lib64/python3.9/configparser.py", line 859, in <listcomp>
    return [(option, value_getter(option)) for option in orig_keys]
  File "/usr/lib64/python3.9/configparser.py", line 855, in <lambda>
    value_getter = lambda option: self._interpolation.before_get(self,
  File "/usr/lib64/python3.9/configparser.py", line 395, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib64/python3.9/configparser.py", line 442, in _interpolate_some
    raise InterpolationSyntaxError(
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: "%REDACTED"

I think I understand that the parsing does not allow that character, so my question is: Can that be catched, or would I need to change my password?

darkphoenix commented 2 years ago

Your error specifically points out a % sign, this appears to be Python trying to interpolate that as a special expression. Since that's not a feature actually used by this code at all as it is right now, I've shut it off in a new commit. I don't have a password containing a % to try, so please update and try again and get back to me if it's still an issue.

thorian93 commented 2 years ago

Awesome reaction time, thanks! Issue is fixed. 👍 I ran directly into the next issue though but that's probably on my end. If necessary I will raise another issue.

Have a good one!