🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@hugovk
Copy link
Member

@hugovk hugovk commented Dec 13, 2025

In the issue @vstinner said:

IMO it's a good idea to use the Python version as the HTTP server version.

However, the Python version is already part of the combined version string: "BaseHTTP/0.6 Python/3.15.0".

This is made up of:

    def version_string(self):
        """Return the server software version string."""
        return self.server_version + ' ' + self.sys_version

And the comments say server_version can be a name without a version:

    # The Python system version, truncated to its first component.
    sys_version = "Python/" + sys.version.split()[0]

    # The server software version.  You may want to override this.
    # The format is multiple whitespace-separated strings,
    # where each string is of the form name[/version].
    server_version = "BaseHTTP/" + __version__

So better to have something like "BaseHTTP Python/3.15.0" rather than "BaseHTTP/3.15.0 Python/3.15.0".


📚 Documentation preview 📚: https://cpython-previews--142658.org.readthedocs.build/

@hugovk hugovk requested a review from AA-Turner as a code owner December 13, 2025 09:51
@hugovk hugovk changed the title Deprecate __version__ attribute in http.server gh-76007: Deprecate __version__ attribute in http.server Dec 13, 2025
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

hugovk and others added 2 commits December 13, 2025 16:59
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@hugovk hugovk enabled auto-merge (squash) December 13, 2025 15:00
@hugovk hugovk merged commit 170dac2 into python:main Dec 13, 2025
46 checks passed
@hugovk hugovk deleted the 3.15-deprecate-__version__-http.server branch December 13, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants