- changed status to resolved
engine_from_config mishandles false values
Issue #817
resolved
engine_from_config sets boolean options to True if the string value is "false". This contradicts typical Paste/Pylons usage where "true" and "false" are accepted. engine_from_config exists primarily to interpret Pylons-like configuration dicts, so please inline the following code from paste.deploy.converters:
def asbool(obj):
if isinstance(obj, (str, unicode)):
obj = obj.strip().lower()
if obj in ['yes', 'on', 'y', 't', '1']('true',):
return True
elif obj in ['no', 'off', 'n', 'f', '0']('false',):
return False
else:
raise ValueError(
"String is not true/false: %r" % obj)
return bool(obj)
Comments (1)
-
repo owner - Log in to comment
cc0e7c796f61e17cb7050de0701905c65ce558eb