Skip to content

Error with Passwords containing '%' #58

Description

@jameskupke

This is a minor issue, it appears that the password string is not escaped properly and will error out if it has a %

Here is code output (with some items redacted):

> python zap2it-GuideScrape.py
Namespace(configfile=None, outputfile=None, language=None, findid=False, channels=False, web=False)
Loading config:  ./zap2itconfig.ini  and outputting:  xmlguide.xmltv
Traceback (most recent call last):
  File "/path_to_app/zap2it-GuideScrape.py", line 476, in <module>
    guide.BuildGuide()
    ~~~~~~~~~~~~~~~~^^
  File "/path_to_app/zap2it-GuideScrape.py", line 323, in BuildGuide
    self.Authenticate()
    ~~~~~~~~~~~~~~~~~^^
  File "/path_to_app/zap2it-GuideScrape.py", line 64, in Authenticate
    authRequest = self.BuildAuthRequest()
  File "/path_to_app/zap2it-GuideScrape.py", line 53, in BuildAuthRequest
    "password": self.get_config_value("creds","password"),
                ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/path_to_app/zap2it-GuideScrape.py", line 47, in get_config_value
    return self.config.get(section, key, fallback=fallback)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.14/configparser.py", line 848, in get
    return self._interpolation.before_get(self, section, option, value,
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                          d)
                                          ^^
  File "/usr/lib64/python3.14/configparser.py", line 430, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.14/configparser.py", line 477, in _interpolate_some
    raise InterpolationSyntaxError(
    ...<2 lines>...
        "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%PASSWORDREMOVED'

Workaround is pretty easy, I just changed to a different password that didn't have a % and was able to get the XML.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions