Skip to content

Removed potential cause of error when using configparser with env var

Karsten Prehn requested to merge fix/configparser-percent-interpolation-error into main

When initializing the config parser with an environment variable that contains an item like %s %s, the parser throws an interpolation error when trying to read that item, or when casting the whole parsed config to a dictionary. (it expects something like %(home_dir)s)

This MR changes the check from casting the entire parsed config to dict and testing for empty to testing whether the configparser::read function returned something.

\approve @ds @laurens

Edited by Karsten Prehn

Merge request reports