-
Notifications
You must be signed in to change notification settings - Fork 125
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
west config
corner cases when setting option foo.bar=baz
#779
Comments
Perhaps consider just forbidding equal signs in the names of configs? Config files are stored in a init-style format, and although have spaces, I suspect don't parse. It doesn't seem the library is expecting these names, and may very well have other characters that aren't workable. yaml will allow almost anything, if quoted is only going to include alphanumeric, digits, '-', '_',. Dot is allowed but it gets weirdly ambiguous if we are parsing dots. Most punctuation is not allowed, without quoting. |
Oh, and yaml will do really weird things if the key can be interpreted as a boolean. It works fine, but the key in the dict is actually the boolean, not a string. Likewise the same will happen with valid numbers. |
Yes: first '=' sign wins. configparser happily accepts equal signs in keys, writes them to the .ini file without quoting or escaping, and finally interprets the first Simplest demo:
It's confusing because the way
Yes; with a pointer to the corresponding
Does |
https://docs.python.org/3/library/configparser.html#customizing-parser-behaviour states:
... but |
configparser bug filed with reproduction: |
Someone just linked that bug to other, similar lacks of input validation.
Apparently you can even fool |
This command:
should, I think, either error out, or set an option named
foo.bar=baz
toqux
.Instead, it does some mix of the two, because afterwards, running:
results in west exiting 1 with the option unset , but
something is wrong here, likely related to how configparser deals with
=
signsThe text was updated successfully, but these errors were encountered: