Jump to solution
Verify

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%.

Jump to Verify Open PR/Commit
@@ -1,5 +1,14 @@ .. currentmodule:: flask +Version 1.1.2 +------------- +
repro.py
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)
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
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).
Production impact:
  • 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.”
@davidism · 2019-07-10 · source

Failure Signature (Search String)

  • Error: no such option: --host

Error Message

Stack trace
error.txt
Error Message ------------- Error: no such option: --host

Minimal Reproduction

repro.py
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.

When NOT to use: This fix should not be used if the Click issue is resolved.

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.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix should not be used if the Click issue is resolved.

Verify Fix

verify
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

VersionStatus
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.