From acd6e51fbca57356f38c39e4c593484bc24b5e6e Mon Sep 17 00:00:00 2001 From: Miloslav Pojman Date: Thu, 5 Jan 2023 14:01:35 +0100 Subject: [PATCH] Change default --app-dir from from "." (dot) to "" (empty string). Both the dot and empty string are interpreted as the current working directory but Python, but the dot causes ugly __file__ of imported modules. The empty string is consistent with Python behavior, inserting an empy string to sys.path when running interactively. --- docs/deployment.md | 2 +- docs/index.md | 2 +- uvicorn/main.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/deployment.md b/docs/deployment.md index 65c6f0e9a..b65c4319e 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -119,7 +119,7 @@ Options: --version Display the uvicorn version and exit. --app-dir TEXT Look for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to - the current working directory. [default: .] + the current working directory. --h11-max-incomplete-event-size INTEGER For h11, the maximum number of bytes to buffer of an incomplete event. diff --git a/docs/index.md b/docs/index.md index 6353a5866..2447f28e4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -186,7 +186,7 @@ Options: --version Display the uvicorn version and exit. --app-dir TEXT Look for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to - the current working directory. [default: .] + the current working directory. --h11-max-incomplete-event-size INTEGER For h11, the maximum number of bytes to buffer of an incomplete event. diff --git a/uvicorn/main.py b/uvicorn/main.py index 3c59fa131..ced75d002 100644 --- a/uvicorn/main.py +++ b/uvicorn/main.py @@ -335,7 +335,7 @@ def print_version(ctx: click.Context, param: click.Parameter, value: bool) -> No ) @click.option( "--app-dir", - default=".", + default="", show_default=True, help="Look for APP in the specified directory, by adding this to the PYTHONPATH." " Defaults to the current working directory.",