Skip to content
Unverified Commit 71907e28 authored by Dimitri Papadopoulos Orfanos's avatar Dimitri Papadopoulos Orfanos Committed by GitHub
Browse files

Read config file without interpolation (#2545)

Some config files use interpolation, some do not:
https://docs.python.org/3/library/configparser.html#interpolation-of-values

Config files might contain occurrences of `%` that should not be
interpolated. When attempting to interpolate them, `ConfigParser`
crashes with:
	ValueError: invalid interpolation syntax

Therefore, we decide to disable interpolation, to avoid crashes.
We do not expect interpolation in the `[codespell]` section, so
it is not a problem in practice.

Alternatively, we could read with interpolation, and in the case of
a ValueError exception, retry without interpolation. However, since
we do not expect interpolation in the `[codespell]` section, I believe
the current solution is simpler, faster, to the point.
parent 2461abc8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment