Skip to content

Commit

Permalink
CA-391485: Avoid InterpolationSyntaxError by turning off interpolation
Browse files Browse the repository at this point in the history
OTEL_RESOURCE_ATTRIBUTES is in W3CBaggageFormat and thus uses %.
ConfigParser attempts to interpolate these % signs but we want them to
be left alone, so set interpolation=None

Signed-off-by: Steven Woods <[email protected]>
  • Loading branch information
snwoods committed Apr 11, 2024
1 parent e3d2299 commit cee08ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python3/packages/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _get_configs_list(config_dir):
def read_config(config_path, header):
"""Read a config file and return a dictionary of key-value pairs."""

parser = configparser.ConfigParser()
parser = configparser.ConfigParser(interpolation=None)
with open(config_path, encoding="utf-8") as config_file:
try:
parser.read_string(f"[{header}]\n{config_file.read()}")
Expand Down

0 comments on commit cee08ad

Please sign in to comment.