On Sun, Oct 06, 2019 at 06:16:17PM +0100, Stuart Henderson wrote:
> So it turns out this is from the code where it substitutes ${FOO} with the
> contents of the environment variable FOO (this was added in
> https://github.com/pierky/arouteserver/commit/a184b428)
> 
>         def expand_env_vars(doc):
>             res = doc
>             for v in os.environ:
>                 res = re.sub("\$\{" + v + "\}", os.environ[v], res)
Or even better: not using regular expressions at all (untested):

                  res = str.replace("${" + v + "}", os.environ[v], res)

Not sure how re.sub() and str.replace() behave when the pattern/string
does not match or so.

Reply via email to