-
Notifications
You must be signed in to change notification settings - Fork 118
Closed
Description
The following code:
from pyhocon import ConfigFactory
config = ConfigFactory.parse_string("")
for getter in [config.get, config.get_string, config.get_list, config.get_int, config.get_float, config.get_config, config.get_bool]:
try:
getter("missing_value")
except Exception as exc:
print str(getter), type(exc)
print "\t", excproduces the following output:
<bound method ConfigTree.get of ConfigTree()> <class 'pyhocon.exceptions.ConfigMissingException'>
u'No configuration setting found for key missing_value'
<bound method ConfigTree.get_string of ConfigTree()> <class 'pyhocon.exceptions.ConfigMissingException'>
u'No configuration setting found for key missing_value'
<bound method ConfigTree.get_list of ConfigTree()> <class 'pyhocon.exceptions.ConfigMissingException'>
u'No configuration setting found for key missing_value'
<bound method ConfigTree.get_int of ConfigTree()> <class 'pyhocon.exceptions.ConfigMissingException'>
u'No configuration setting found for key missing_value'
<bound method ConfigTree.get_float of ConfigTree()> <class 'pyhocon.exceptions.ConfigMissingException'>
u'No configuration setting found for key missing_value'
<bound method ConfigTree.get_config of ConfigTree()> <class 'pyhocon.exceptions.ConfigMissingException'>
u'No configuration setting found for key missing_value'
<bound method ConfigTree.get_bool of ConfigTree()> <class 'pyhocon.exceptions.ConfigException'>
missing_value does not translate to a Boolean value
All the "getters", except get_bool, raise pyhocon.exceptions.ConfigMissingException, while get_bool raises pyhocon.exceptions.ConfigException.
This bug/inconsistency was introduced in the change from 0.3.35 -> 0.3.36.
Tested with Python 2.7.5
Metadata
Metadata
Assignees
Labels
No labels