#30137: Replace use of OSError aliases with OSError (IOError, EnvironmentError,
WindowsError, mmap.error, socket.error, select.error)
------------------------------------------------+------------------------
Reporter: Jon Dufresne | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Starting with Python 3.3, `EnvironmentError`, `IOError`, `WindowsError`,
`socket.error`, `select.error` and `mmap.error` are aliases of `OSError`.
With this in mind, the Django code base can be cleaned up.
For additional details, see the Python 3.3 release notes:
https://docs.python.org/3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-
io-exception-hierarchy
> You don’t have to worry anymore about choosing the appropriate exception
type between `OSError`, `IOError`, `EnvironmentError`, `WindowsError`,
`mmap.error`, `socket.error` or `select.error`. All these exception types
are now only one: `OSError`. The other names are kept as aliases for
compatibility reasons.
Additionally, since Python 3.4, `SMTPException` is subclass of `OSError`
. So exception handles catching both can be simplified to just `OSError`.
https://docs.python.org/3/library/smtplib.html#smtplib.SMTPException
> Subclass of `OSError` that is the base exception class for all the other
exceptions provided by this module.
>
> Changed in version 3.4: SMTPException became subclass of OSError
--
Ticket URL: <https://code.djangoproject.com/ticket/30137>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.a46c1e0ba9b4c6b39642f6346ef3cf24%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.