# HG changeset patch # User Franz Glasner # Date 1590041943 -7200 # Node ID bfa4d125fd144b64e96a95ab359f7ed8277a1afc # Parent f3c3bfc2bcbe2d098f7ce8f0c9e01f2cd151ce98 FIX: The namespace lookup implementation for the "OS" namespace did not properly handle the "default" argument. It has been ignored entirely. diff -r f3c3bfc2bcbe -r bfa4d125fd14 CHANGES.txt --- a/CHANGES.txt Wed May 13 09:45:13 2020 +0200 +++ b/CHANGES.txt Thu May 21 08:19:03 2020 +0200 @@ -13,6 +13,17 @@ -------------- .. changelog:: + :version: n/a + :released: n/a + + .. change:: + :tags: bugfix + + The ``OS`` namespace lookup did not handle non-existing variables + properly and ignored the `default` parameter. + + +.. changelog:: :version: 0.7.3 :released: 2020-05-13 diff -r f3c3bfc2bcbe -r bfa4d125fd14 configmix/variables.py --- a/configmix/variables.py Wed May 13 09:45:13 2020 +0200 +++ b/configmix/variables.py Thu May 21 08:19:03 2020 +0200 @@ -36,7 +36,11 @@ """Lookup some process and/or OS state """ if name == "cwd": return native_os_str_to_text(os.getcwd()) - raise KeyError("key %r not found in the namespace" % name) + else: + if default is _MARKER: + raise KeyError("key %r not found in the namespace" % name) + else: + return default def _pylookup(name, default=_MARKER):