Skip to content

Click 8.2.2 breaks auto-reloader-active on flask --debug #3024

@liffiton

Description

@liffiton

On upgrading click to version 8.2.2, flask --debug run no longer automatically enables the reloader. If I downgrade click to 8.2.1, it works again.

$ uv pip install flask
Using Python 3.13.2 environment at: venv
Resolved 7 packages in 2ms
Installed 7 packages in 3ms
 + blinker==1.9.0
 + click==8.2.2
 + flask==3.1.1
 + itsdangerous==2.2.0
 + jinja2==3.1.6
 + markupsafe==3.0.2
 + werkzeug==3.1.3

$ cat app.py 
from flask import Flask

app = Flask(__name__)

if __name__ == '__main__':
    app.run()

$ flask run --debug
 * Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit
^C

$ uv pip install click==8.2.1
Using Python 3.13.2 environment at: venv
Resolved 1 package in 1ms
Uninstalled 1 package in 0.65ms
Installed 1 package in 1ms
 - click==8.2.2
 + click==8.2.1

$ flask run --debug
 * Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 575-957-529

[From my trace, it looks like the issue affects the debugger as well, but I haven't been using or testing that.]

This appears to be connected to #2952, but I'm not sure if the issue is now in click or in how flask is using click.

The issue occurs because the --reload/--no-reload option is now defaulting to False when it is not specified on the command line, meaning the if reload is None: condition is not triggered to activate the reloader based on the debug flag.

Environment:

  • Python version: 3.13.3
  • Flask version: 3.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions