summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt6
-rw-r--r--src/waitress/trigger.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index c45356e..56e3340 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,6 +4,12 @@ Next Release
Bugfix
~~~~~~
+- In Python 3 ``OSError`` is no longer subscriptable, this caused failures on
+ Windows attempting to loop to find an socket that would work for use in the
+ trigger.
+
+ See https://github.com/Pylons/waitress/pull/361
+
- Fixed an issue whereby ``BytesIO`` objects were not properly closed, and
thereby would not get cleaned up until garbage collection would get around to
it.
diff --git a/src/waitress/trigger.py b/src/waitress/trigger.py
index 3b1ad46..49b2034 100644
--- a/src/waitress/trigger.py
+++ b/src/waitress/trigger.py
@@ -173,7 +173,7 @@ else: # pragma: no cover
w.connect(connect_address)
break # success
except OSError as detail:
- if detail[0] != errno.WSAEADDRINUSE:
+ if getattr(detail, "winerror", None) != errno.WSAEADDRINUSE:
# "Address already in use" is the only error
# I've seen on two WinXP Pro SP2 boxes, under
# Pythons 2.3.5 and 2.4.1.