sphinxext doesn't handle percentage signs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.config |
Fix Released
|
Undecided
|
Stephen Finucane |
Bug Description
The sphinxext module [1] attempts to allow string substitution for default values in 'Opt.help'. For example:
cfg.
help='Does something. Defaults to %(default)s')
While I'd question the value of even including this functionality when we could simply print any defaults found separately, it is what it is. However, the feature does break when percentage signs are used and not escaped. For example, the following option from nova [2]:
cfg.FloatOpt(
default=1.0,
min=0,
deprecate
deprecate
deprecate
The torrent feature has not been tested nor maintained, and as such is being
removed.
""",
help=
will produce the following traceback:
Traceback (most recent call last):
File "setup.py", line 29, in <module>
pbr=True)
File "/usr/lib64/
dist.
File "/usr/lib64/
self.
File "/usr/lib64/
cmd_obj.run()
File "/openstack/
self.
...
...
...
File "/openstack/
for line in lines:
File "/openstack/
help_text = opt.help % {'default': 'the value above'}
ValueError: unsupported format character ')' (0x29) at index 54
Given that oslo.config in general doesn't complain about these signs nor attempt any such substitution, we should probably handle this a little more gracefully than we do.
[1] https:/
[2] https:/
Fix proposed to branch: master /review. openstack. org/449576
Review: https:/