For example, the readme states that the accepted values for the multi_docs import statement paremeter are True and False
https://github.com/jdoiro3/mkdocs-multirepo-plugin/blob/78132fa45f64b75ea59cbbdcf61ccdab3e00fc3f/README.md#import-statement
However, this is not accurate, because these query string values are not interpreted as Python expressions, but are read as strings, and then converted into booleans:
|
for part in query_parts: |
|
k, v = part.split("=") |
|
if v[0] == "[" and v[len(v) - 1] == "]": |
|
try: |
|
import_parts[k] = [lst_v.strip() for lst_v in ast.literal_eval(v)] |
|
except ValueError: |
|
raise ImportSyntaxError( |
|
f"{v} is not a properly formatted python list\nException raised for import statement: {repo_url}" |
|
) |
|
else: |
|
import_parts[k] = v |
|
multi_docs=bool(import_stmt.get("multi_docs", False)), |
So the query string value "False" (or any other non-empty string value) is converted to True
For example, the readme states that the accepted values for the
multi_docsimport statement paremeter areTrueandFalsehttps://github.com/jdoiro3/mkdocs-multirepo-plugin/blob/78132fa45f64b75ea59cbbdcf61ccdab3e00fc3f/README.md#import-statement
However, this is not accurate, because these query string values are not interpreted as Python expressions, but are read as strings, and then converted into booleans:
mkdocs-multirepo-plugin/mkdocs_multirepo_plugin/structure.py
Lines 59 to 69 in 78132fa
mkdocs-multirepo-plugin/mkdocs_multirepo_plugin/structure.py
Line 149 in 78132fa
So the query string value "False" (or any other non-empty string value) is converted to
True