Closed a1s closed 7 months ago
When Quart development server is run in auto-reload mode from a Python script, reload() puts the script name at the end of the command line. So the command line arguments are passed to the Python interpreter and not to the application script.
reload()
Example script:
import sys import click from quart import Quart app = Quart(__file__) @click.command() @click.option("-c", "--config") def run(config): click.echo(sys.argv) app.run(debug=True) if __name__ == "__main__": run()
When this script is run with option -c whatever, auto-reload fails:
-c whatever
Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'whatever' is not defined
Environment:
This fixes the error: reload.patch
Thanks fixed in b2b7d48ad35a227dbd14ad6a6be694e595d215aa
When Quart development server is run in auto-reload mode from a Python script,
reload()
puts the script name at the end of the command line. So the command line arguments are passed to the Python interpreter and not to the application script.Example script:
When this script is run with option
-c whatever
, auto-reload fails:Environment: