The Fix
Upgrade to version 1.1.2 or later.
Based on closed pallets/flask issue #3297 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -1,5 +1,14 @@
.. currentmodule:: flask
+Version 1.1.2
+-------------
+
python -m ptvsd --host localhost --port 5692 -m flask run --no-debugger --no-reload --with-threads --port 5014
* Serving Flask app "app"
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5014/ (Press CTRL+C to quit)
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\nUpgrade to version 1.1.2 or later.\nWhen NOT to use: This fix should not be used if the Click issue is resolved.\n\n
Why This Fix Works in Production
- Trigger: Error: no such option: --host
- Mechanism: Adds back the passing of sys.argv to the Flask CLI to resolve issues with external debuggers on Windows.
- Why the fix works: Adds back the passing of sys.argv to the Flask CLI to resolve issues with external debuggers on Windows. (first fixed release: 1.1.2).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Shows up under Python 2.7 in real deployments (not just unit tests).
- Surfaces as: Error: no such option: --host
Proof / Evidence
- GitHub issue: #3297
- Fix PR: https://github.com/pallets/flask/pull/3299
- First fixed release: 1.1.2
- Reproduced locally: No (not executed)
- Last verified: 2026-02-08
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.69
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“We can add args=sys.argv[1:] back in with a note about the Click issue so we can remove it when that's addressed.”
Failure Signature (Search String)
- Error: no such option: --host
Error Message
Stack trace
Error Message
-------------
Error: no such option: --host
Minimal Reproduction
python -m ptvsd --host localhost --port 5692 -m flask run --no-debugger --no-reload --with-threads --port 5014
* Serving Flask app "app"
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5014/ (Press CTRL+C to quit)
Environment
- Python: 2.7
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 1.1.2 or later.
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/pallets/flask/pull/3299
First fixed release: 1.1.2
Last verified: 2026-02-08. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the Click issue is resolved.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
- Pin production dependencies and upgrade only with a reproducible test that hits the failing path.
Version Compatibility Table
| Version | Status |
|---|---|
| 1.1.2 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.