Issue in python code [ configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%' ] using python 3.7.3 with appium

Below Terminal Logs for your reference

Traceback (most recent call last):
  File "src/Utilities_test/test_cases_csv.py", line 39, in <module>
    report_status = email_reporter(html_report_dir.split('/', 1)[-1])
  File "src/Utilities_support/report_email.py", line 27, in email_reporter for item in conf_data.items(conf): 
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 857, in items
    return [(option, value_getter(option)) for option in d.keys()]
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 857, in <listcomp>
    return [(option, value_getter(option)) for option in d.keys()]
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 854, in <lambda>
    section, option, d[option], d)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 394, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 444, in _interpolate_some
    "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%'

Solution 1:

Most likely the configparser is reading a literal '%' sign in a string. The '%' sign is used for string interpolation (substitution). If you want to have a literal '%' it can be escaped with another '%'. For example, use '100%%' to represent '100%' in the configuration variable read by configparser.