Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smtplib: catch OSError, not SMTPException #2139

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Oct 7, 2024

A backport of a upstream patch for RHEL 9.6.

Upstream commit: aab7def

Resolves: https://issues.redhat.com/browse/RHEL-49743

Some, but not all, types of connection error are caught by smtplib and
reraised as an smtplib.SMTPException. Notably, TimeoutError,
socket.gaierror (name resolution failure), and ConnectionRefusedError
and are not caught.

The more generic OSError should be caught here instead.

Resolves #1905
@ppisar ppisar self-assigned this Oct 7, 2024
Copy link
Contributor

@ppisar ppisar left a comment

Choose a reason for hiding this comment

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

Good.

@ppisar ppisar merged commit ea2d17c into rhel-9.6 Oct 7, 2024
2 of 3 checks passed
@ppisar ppisar deleted the mblaha/automatic-smtp-catch branch October 7, 2024 11:49
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