-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid host/port specified error on Windows #139
Comments
For what values of host/port is this an issue? Everything? Interface names? Interface addresses? IPv6? |
In the tests and manually with |
The waitress test suite is failing for you on windows? We have CI setup so it would be good to know what the difference is there. |
I see now that our CI is only running python 3 and the bug appears to be only on python 2. |
I'm going to need to spin up a Windows VM to test this. I have no idea why |
If you point me to a rough direction where to look in the code, I can debug it tomorrow. |
@fschulze https://github.com/Pylons/waitress/blob/master/waitress/adjustments.py#L245 This is the try block that it is failing on. Most likely It may be because That is what 0.9.0 used to do: https://github.com/Pylons/waitress/blob/v0.9.0/waitress/adjustments.py#L182 However IMHO this is wrong, because |
Or change |
In FreeBSD jails it's not 127.0.0.1 either, so localhost should be looked up if possible. I'll try to debug it. Thanks for the pointers. |
The problem is, that at https://github.com/Pylons/waitress/blob/master/waitress/adjustments.py#L252 |
On OS X/Linux/other UNIXY OS's port may also be a name from For example:
Will start a socket on port This is why the port on those OS's is allowed to be a unicode/string. |
Alright, #141 should fix this issue appropriately since it only affects Python 2 on Windows. Apparently I had a test for the |
Closed by #140 being merged. |
…1.0.1 1.0.1 (2016-10-22) ------------------ Bugfixes ~~~~~~~~ - IPv6 support on Windows was broken due to missing constants in the socket module. This has been resolved by setting the constants on Windows if they are missing. See Pylons/waitress#138 - A ValueError was raised on Windows when passing a string for the port, on Windows in Python 2 using service names instead of port numbers doesn't work with `getaddrinfo`. This has been resolved by attempting to convert the port number to an integer, if that fails a ValueError will be raised. See Pylons/waitress#139
…1.0.1 1.0.1 (2016-10-22) ------------------ Bugfixes ~~~~~~~~ - IPv6 support on Windows was broken due to missing constants in the socket module. This has been resolved by setting the constants on Windows if they are missing. See Pylons/waitress#138 - A ValueError was raised on Windows when passing a string for the port, on Windows in Python 2 using service names instead of port numbers doesn't work with `getaddrinfo`. This has been resolved by attempting to convert the port number to an integer, if that fails a ValueError will be raised. See Pylons/waitress#139
…1.0.1 1.0.1 (2016-10-22) ------------------ Bugfixes ~~~~~~~~ - IPv6 support on Windows was broken due to missing constants in the socket module. This has been resolved by setting the constants on Windows if they are missing. See Pylons/waitress#138 - A ValueError was raised on Windows when passing a string for the port, on Windows in Python 2 using service names instead of port numbers doesn't work with `getaddrinfo`. This has been resolved by attempting to convert the port number to an integer, if that fails a ValueError will be raised. See Pylons/waitress#139
…1.0.1 1.0.1 (2016-10-22) ------------------ Bugfixes ~~~~~~~~ - IPv6 support on Windows was broken due to missing constants in the socket module. This has been resolved by setting the constants on Windows if they are missing. See Pylons/waitress#138 - A ValueError was raised on Windows when passing a string for the port, on Windows in Python 2 using service names instead of port numbers doesn't work with `getaddrinfo`. This has been resolved by attempting to convert the port number to an integer, if that fails a ValueError will be raised. See Pylons/waitress#139
…1.0.1 1.0.1 (2016-10-22) ------------------ Bugfixes ~~~~~~~~ - IPv6 support on Windows was broken due to missing constants in the socket module. This has been resolved by setting the constants on Windows if they are missing. See Pylons/waitress#138 - A ValueError was raised on Windows when passing a string for the port, on Windows in Python 2 using service names instead of port numbers doesn't work with `getaddrinfo`. This has been resolved by attempting to convert the port number to an integer, if that fails a ValueError will be raised. See Pylons/waitress#139
…1.0.1 1.0.1 (2016-10-22) ------------------ Bugfixes ~~~~~~~~ - IPv6 support on Windows was broken due to missing constants in the socket module. This has been resolved by setting the constants on Windows if they are missing. See Pylons/waitress#138 - A ValueError was raised on Windows when passing a string for the port, on Windows in Python 2 using service names instead of port numbers doesn't work with `getaddrinfo`. This has been resolved by attempting to convert the port number to an integer, if that fails a ValueError will be raised. See Pylons/waitress#139
FWIW, socket.getaddrinfo works with service names on windows python 2.x as well, it just doesn't like unicode:
|
That's good to know! |
We use waitress in devpi like this:
and on Windows got #138 with waitress 1.0. To work around that I tried to change to the following:
But then I got
ValueError: Invalid host/port specified.
This only happens on Windows, Linux and OS X is fine. For now we pinned to
waitress<1
.The text was updated successfully, but these errors were encountered: