Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read config file without interpolation #2545

Merged

Commits on Oct 20, 2022

  1. Read config file without interpolation

    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.
    DimitriPapadopoulos committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    e40ea0e View commit details
    Browse the repository at this point in the history