Skip to content

Conversation

@hugovk
Copy link
Member

@hugovkhugovk 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:

defversion_string(self): """Return the server software version string."""returnself.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/

@hugovkhugovk changed the title Deprecate __version__ attribute in http.servergh-76007: Deprecate __version__ attribute in http.serverDec 13, 2025
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM

hugovkand others added 2 commits December 13, 2025 16:59
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@hugovkhugovk enabled auto-merge (squash) December 13, 2025 15:00
@hugovkhugovk merged commit 170dac2 into python:mainDec 13, 2025
46 checks passed
@hugovkhugovk deleted the 3.15-deprecate-__version__-http.server branch December 13, 2025 15:32
Sign up for freeto 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

@hugovk@vstinner@StanFromIreland