Skip to content

gh-76007: Deprecate __version__ attribute in imaplib - #140299

Merged
hugovk merged 2 commits into
python:mainfrom
hugovk:3.15-deprecate-__version__-imaplib
Oct 20, 2025
Merged

gh-76007: Deprecate __version__ attribute in imaplib#140299
hugovk merged 2 commits into
python:mainfrom
hugovk:3.15-deprecate-__version__-imaplib

Conversation

@hugovk

@hugovkhugovk commented Oct 18, 2025

Copy link
Copy Markdown
Member

Also remove it from the debug output:

 if __debug__:
self._cmd_log_len = 10
self._cmd_log_idx = 0
self._cmd_log = {} # Last '_cmd_log_len' interactions
if self.debug >= 1:
- self._mesg('imaplib version %s' % __version__)
self._mesg('new IMAP4 connection, tag=%s' % self.tagpre)

@picnixz Or would you prefer to put the Python version here?


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

@hugovkhugovk changed the title Deprecate __version__ attribute in imaplibgh-76007: Deprecate __version__ attribute in imaplibOct 18, 2025
@picnixz

Copy link
Copy Markdown
Member

I think it is fine to remove it. We anyway have a divergence between 3.13 and 3.14 because 3.14 had a new feature and 3.13 and 3.14 had bugfixes that I addes, so it would only help if we had both the version of Python and the IMAP one.

IMO such debugging information could only be useful if the Python version also included the git commit it is based on but that would be an overkill I think.

Comment threadLib/imaplib.py Outdated
Co-authored-by: Victor Stinner <vstinner@python.org>

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@hugovk
hugovk merged commit 99c3c63 into python:mainOct 20, 2025
49 checks passed
@hugovk
hugovk deleted the 3.15-deprecate-__version__-imaplib branch October 20, 2025 12:20
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
…n#140299)
Co-authored-by: Victor Stinner <vstinner@python.org>
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.

4 participants

@hugovk@picnixz@vstinner@johnslavik