Skip to content

Conversation

@nmartensen
Copy link

@nmartensen nmartensen commented Feb 10, 2024

@nmartensen nmartensen requested a review from a team as a code owner February 10, 2024 21:09
@ghost
Copy link

ghost commented Feb 10, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Feb 10, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

nmartensen and others added 3 commits February 19, 2024 21:51
@nmartensen nmartensen force-pushed the 70039_smtplib_host_port branch from 5d822a0 to 5ea81fc Compare February 19, 2024 21:16
@nmartensen
Copy link
Author

The PR adds 6 tests in addition to the functional change. Most of them fail without the change:

  • In Lib/test/test_smtplib.py:DebuggingServerTests
    • test_host_port_host [fails] *
    • test_explicit_connect [fails]
    • text_explicit_connect_host_port [fails]
  • In Lib/test/test_smtpnet.py:SmtpTest
    • test_connect_host_port_starttls
    • test_explicit_connect_starttls [fails]
    • test_explicit_connect_host_port_starttls [fails]

The one that does not fail describes a situation that could sometimes also fail in practice before the change, see e.g. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926900. The test marked with '*' above is meant to ensure this failure case won't be accidentally reintroduced in potential future changes.

@AliceGrey
Copy link

Any chance of getting this reviewed and merged? This bug has been open since 2019 and is still causing issues. This PR is excellent. It fixes the issue and adds several tests.

@jahs
Copy link

jahs commented Dec 17, 2025

Hi all, I'd like to echo the above as this is still an issue (going back to 2015). Caused an issue this week (December 2025) due to AWS SES eu-west-2 applying strict parsing in TLS of the self._host string (which they rolled back, in part due to this client bug). Specifically, the SMTP("host:port") constructor was used and it failed to connect, as the connect() parsing currently does not update self._host, which is then used in starttls().

@bedevere-app
Copy link

bedevere-app bot commented Dec 21, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

There are already other tests for the functionality, therefore there is
no need to test implementation details.
@nmartensen
Copy link
Author

nmartensen commented Dec 23, 2025

I have made the requested changes; please review again.

@bedevere-app
Copy link

bedevere-app bot commented Dec 23, 2025

Thanks for making the requested changes!

@bitdancer: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from bitdancer December 23, 2025 19:13
@nmartensen
Copy link
Author

There seem to be failing tests with this PR now. I have looked into them but fail to see what is needed to fix them. Please let me know if you know more.

@bitdancer
Copy link
Member

I think all you need to do is update to the tip of main. Let's try that, at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants