This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Move IP version resolving to http.server's API
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: jaraco, pavel-lexyr
Priority: normal Keywords:

Created on 2021-06-28 17:41 by pavel-lexyr, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg396655 - (view) Author: pavel-lexyr (pavel-lexyr) * Date: 2021-06-28 17:41
Python's native HTTP server (http.server module) has special code to allow it to detect and bind to IPv6 addresses when called as a CLI tool. As of right now, the code is in private functions. Those are not intended to be called by library users - only the CLI command. People want to create HTTP/WSGI servers programmatically - then they run into similar problems. Since the relevant code is not open for library use, they copy it to their own projects instead. That's code duplication.

Exhibit A: https://github.com/prometheus/client_python/pull/657

This doesn't look like a good way to do things. To avoid such problems, it can be useful to have the CLI tool's protocol version resolver added to the library.

This relates to bpo-20215, which has related aspirations - but a broader scope.
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88694
2021-06-28 17:41:20pavel-lexyrcreate