[New-bugs-announce] [issue46436] Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler

Géry report at bugs.python.org
Wed Jan 19 12:39:40 EST 2022


New submission from Géry <gery.ogam at gmail.com>:

The API of [`http.server`](https://docs.python.org/3/library/http.server.html) supports the `directory` optional parameter for `CGIHTTPRequestHandler` (which is inherited from `SimpleHTTPRequestHandler`). The CLI of `http.server` supports the corresponding `-d/--directory` option.

The `-d/--directory` option is passed to `SimpleHTTPRequestHandler` as the `directory` argument:

> python -m http.server --directory /tmp/

But the `-d/--directory` option is not passed to `CGIHTTPRequestHandler` (which is enabled with the `--cgi` option):

> python -m http.server --directory /tmp/ --cgi

So the option is ignored in that case.

----------
components: Library (Lib)
messages: 410973
nosy: docs at python, maggyero
priority: normal
pull_requests: 28899
severity: normal
status: open
title: Pass the -d/--directory command-line option to http.server.CGIHTTPRequestHandler
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46436>
_______________________________________


More information about the New-bugs-announce mailing list