Skip to content

Commit

Permalink
FIX Escape characters in dotlist
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagusiak committed Jun 20, 2022
1 parent 3c818bc commit ecc0605
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions alphaconf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,12 @@ def _get_configurations(
prefixes = None
if prefixes:
_log.debug('Loading env configuration from prefixes %s' % (prefixes,))
yield OmegaConf.from_dotlist(
[
"%s=%s" % (name.lower().replace('_', '.'), value)
for name, value in os.environ.items()
if name.startswith(prefixes)
]
)
dotlist = [
"%s=\"%s\"" % (name.lower().replace('_', '.').replace('"', '\\"'), value)
for name, value in os.environ.items()
if name.startswith(prefixes)
]
yield OmegaConf.from_dotlist(dotlist)

def setup_configuration(
self,
Expand Down

0 comments on commit ecc0605

Please sign in to comment.