williamh / pybugz

Python interface to Bugzilla.
http://www.liquidx.net/pybugz/
GNU General Public License v2.0
80 stars 60 forks source link

Incorrect usage of interpolation character in configuration files causes traceback #90

Closed wraeth closed 8 years ago

wraeth commented 9 years ago

Either using .buzrc or bugz ... -p with a password containing a percent character causes the script to fail with the below trace. Note that you can escape the percent by adding another percent - for example, for a password of my%pass you could have password: my%%pass in .bugzrc.

Trace:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/bugz", line 70, in <module>
    sys.exit(main())
  File "/usr/lib/python-exec/python3.4/bugz", line 44, in main
    get_config(args)
  File "/usr/lib64/python3.4/site-packages/bugz/configfile.py", line 61, in get_config
    fill_config(args, parser, section)
  File "/usr/lib64/python3.4/site-packages/bugz/configfile.py", line 28, in fill_config
    fill_config_option(args, parser, parser.get, section, 'password')
  File "/usr/lib64/python3.4/site-packages/bugz/configfile.py", line 21, in fill_config_option
    value = config_option(parser, get, section, option)
  File "/usr/lib64/python3.4/site-packages/bugz/configfile.py", line 10, in config_option
    if get(section, option) != '':
  File "/usr/lib64/python3.4/configparser.py", line 773, in get
    d)
  File "/usr/lib64/python3.4/configparser.py", line 374, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib64/python3.4/configparser.py", line 423, in _interpolate_some
    "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%REDACTED'