app icon indicating copy to clipboard operation
app copied to clipboard

Handle unset and false variables the same way

Open ymage opened this issue 3 years ago • 4 comments

Some variables set with a False value are handled as True because the test is only on existence. cf #1249

ymage avatar Sep 19 '22 09:09 ymage

We cannot change this config like that. It will break already existing configs.

acasajus avatar Sep 19 '22 12:09 acasajus

I understand.

My point is : when you set some boolean vars as False, they are processed as "if it is set, it must be True" which is really disturbing :-/ How would be the right way to ensure that False are processed as False ?

ymage avatar Sep 20 '22 11:09 ymage

What do you think about the opposite default ? Something like this : COLOR_LOG = os.environ.get("COLOR_LOG", 'False').lower() not in ('false', '0', 'f')

ymage avatar Sep 20 '22 11:09 ymage

Can you give it a try and take a look ?

ymage avatar May 18 '23 21:05 ymage