From c6b8a3d608b7842600b343f78e809b005b7fc0e4 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Thu, 18 Apr 2024 10:26:36 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[-bug]=20Fixed=20issue=20with=20?= =?UTF-8?q?empty=20StreamDecorators=20and=20capabilities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Default Capabilities are created for empty StreamDecorators (e.g. `StreamDecorator(None)`). However, the default Capabilities constructor looks at environment variables to override values when none are provided. In this case, we don't want to look at those values and use the lowest settings available. The fix is to ignore the environment when creating the Capabilities to associate with the empty StreamDecorator. --- src/dbrownell_Common/Streams/StreamDecorator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbrownell_Common/Streams/StreamDecorator.py b/src/dbrownell_Common/Streams/StreamDecorator.py index a105aec..4526f90 100644 --- a/src/dbrownell_Common/Streams/StreamDecorator.py +++ b/src/dbrownell_Common/Streams/StreamDecorator.py @@ -117,7 +117,7 @@ def PrefixOrSuffixTToCallable( capabilities = lowest_capabilities else: - capabilities = Capabilities() + capabilities = Capabilities(ignore_environment=True) Capabilities.Set(self, capabilities)