diff options
-rw-r--r-- | Doc/library/smtplib.rst | 4 | ||||
-rw-r--r-- | Doc/whatsnew/3.4.rst | 11 | ||||
-rw-r--r-- | Lib/smtplib.py | 2 | ||||
-rw-r--r-- | Misc/NEWS | 2 |
4 files changed, 16 insertions, 3 deletions
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst index 9593dea..04036dc 100644 --- a/Doc/library/smtplib.rst +++ b/Doc/library/smtplib.rst @@ -103,8 +103,8 @@ A nice selection of exceptions is defined as well: .. exception:: SMTPException - The base exception class for all the other excpetions provided by this - module. + Subclass of :exc:`IOError` that is the base exception class for all + the other excpetions provided by this module. .. exception:: SMTPServerDisconnected diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index 75ac8ba..2b6193a 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -151,12 +151,23 @@ New Modules Improved Modules ================ + doctest ------- Added ``FAIL_FAST`` flag to halt test running as soon as the first failure is detected. (Contributed by R. David Murray and Daniel Urban in :issue:`16522`.) + +smtplib +------- + +:exc:`~smtplib.SMTPException` is now a subclass of :exc:`IOError`, which allows +both socket level errors and SMTP protocol level errors to be caught in one +try/except statement by code that only cares whether or not an error occurred. +(:issue:`2118`). + + wave ---- diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 50a087c..a5a9fd4 100644 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -66,7 +66,7 @@ bCRLF = b"\r\n" OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I) # Exception classes used by this module. -class SMTPException(Exception): +class SMTPException(IOError): """Base class for all exceptions raised by this module.""" class SMTPServerDisconnected(SMTPException): @@ -42,6 +42,8 @@ Core and Builtins Library ------- +- Issue #2118: SMTPException is now a subclass of IOError. + - Issue #17016: Get rid of possible pointer wraparounds and integer overflows in the re module. Patch by Nickolai Zeldovich. |