Skip to content

Conversation

@seanthegeek
Copy link
Contributor

@seanthegeek seanthegeek commented Dec 6, 2025

Fix #618 without needing to access undocumented Python imaplib attributes that should not be modified, such as file. Tested against Gmail IMAP TLS on Python 3.8, 3.13, and 3.14 using this test script

import ssl
from imapclient import IMAPClient


HOST = "imap.gmail.com"
PORT = 993


def main() -> None:
    ctx = ssl.create_default_context()
    with IMAPClient(
        HOST,
        port=PORT,
        ssl=True,
        ssl_context=ctx,
        timeout=30,
    ) as client:
        print("Connected to:", HOST, PORT)
        print("welcome:", client.welcome)

        caps = client.capabilities()
        print("capabilities:", caps)
        print("Successfully connected and ran CAPABILITY without auth.")


if __name__ == "__main__":
    main()

See also

python/cpython#142307
seanthegeek/mailsuite#15
domainaware/parsedmarc#636

@JohnVillalovos
Copy link
Contributor

Would it also make sense to update .github/workflows/main.yml to use Python 3.14?

@seanthegeek
Copy link
Contributor Author

seanthegeek commented Dec 6, 2025

Would it also make sense to update .github/workflows/main.yml to use Python 3.14?

Good point. Added to workflow and updated docs.

@mjs
Copy link
Owner

mjs commented Dec 30, 2025

Thank you very much for this - an excellent change. Would you be able to address the black formatting issue? I'll then get this merged.

@seanthegeek
Copy link
Contributor Author

Done

@mjs mjs merged commit 73b2cea into mjs:master Jan 2, 2026
8 of 9 checks passed
@mjs
Copy link
Owner

mjs commented Jan 2, 2026

Thanks! There's still a flake8 issue (unused import) but I'll merge and fix this myself.

@jmartens
Copy link

jmartens commented Jan 5, 2026

Any changes a release is made with this fix included?

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.

AttributeError: property 'file' of 'IMAP4_TLS' object has no setter on Python 3.14

4 participants