#26011: allow_reuse_address = 1 on WSGIServer can cause random test failures in
LiveServerTestCase on Windows
-----------------------------------+------------------------------------
Reporter: knbk | Owner: knbk
Type: Bug | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Comment (by knbk):
I think this patch exposes an existing bug. The current code expects the
error when a socket is in use to be an `socket.error` instance, but
apparently it raises an `OSError` in some circumstances. According to the
Py3 docs, an `OSError` should automatically be "upgraded" to the
appropriate error type, but that doesn't seem to happen here. For our case
it should be sufficient to catch an `OSError` as well (we still need to
catch `socket.error` on Py2), and check the error code. I'm not sure why
the `OSError` constructor does not return a `socket.error`, this might be
a bug in Python. I'll investigate this later.
--
Ticket URL: <https://code.djangoproject.com/ticket/26011#comment:10>
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/062.824fc91e9387123b5ce2f9da7c959643%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.