Replace eval with ast.literal_eval#1308
Conversation
|
There is no such a risk here, since the input is safe. And while I am all for removing the use of |
|
Input is likely safe, but it's still a file which can be changed by any other program without the user noticing. Perhaps instead you could load values as YAML: |
|
Yes, or lower-case them and use JSON (since there is no built-in YAML support). Of I have not looked into the source of the values or into whether or not other values besides those 2 are possible. |
|
In my own projects, I use: is_true = string_value.lower() not in {"", "0", "n", "no", "off", "false"} |
Reducing security risk of running arbitrary code.
Resolves #1056