You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importosos.environ["USER"] ="test"frompyhoconimportConfigFactoryconfig=ConfigFactory.parse_file("base.conf")
print(config["submit_user"]) # works as expectedconfig=ConfigFactory.parse_file("other.conf")
print(config["submit_user"]) # fails
Stacktrace:
Traceback (most recent call last):
File "/.../config_test.py", line 10, in <module>
print(config["submit_user"]) # fails
File "/.../config_tree.py", line 393, in __getitem__
val = self.get(item)
File "/.../config_tree.py", line 236, in get
return self._get(ConfigTree.parse_key(key), 0, default)
File "/.../config_tree.py", line 176, in _get
raise ConfigMissingException(
pyhocon.exceptions.ConfigMissingException: 'No configuration setting found for key submit_user'
Removing the second substitution submit_user = ${?USERNAME} makes it work again though. It's not expected behavior, since the statement should be ignored if nothing is being set.
I tried digging into the code to fix it, but could not figure it out. Happy to help if someone has some hints.
The text was updated successfully, but these errors were encountered:
I noticed an issue that I can not substitute twice in an included config. See the following example:
base.conf:
other.conf
Python code:
Stacktrace:
Removing the second substitution
submit_user = ${?USERNAME}
makes it work again though. It's not expected behavior, since the statement should be ignored if nothing is being set.I tried digging into the code to fix it, but could not figure it out. Happy to help if someone has some hints.
The text was updated successfully, but these errors were encountered: