Skip to content

Commit

Permalink
Merge pull request #361 from Pylons/bugfix/winerror-windows
Browse files Browse the repository at this point in the history
Bugfix on Windows: OSError is not subscriptable
  • Loading branch information
mmerickel committed Jan 17, 2022
2 parents a186822 + faec8a2 commit 640c9af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/waitress/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def __init__(self, map):
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.
Expand Down

0 comments on commit 640c9af

Please sign in to comment.