-
Notifications
You must be signed in to change notification settings - Fork 761
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
URL parsing is broken #4
Comments
It sounds strange. My python 2.6.1 and 2.5.4 on Mac woks fine. Please tell me the traceback or exception detail. |
Wow, that is strange. Neither the 2.6.1 or 2.5.4 on my Mac work. To recreate: $ python --version Python 2.6.1 $ cd /tmp/liris-websocket-client-673470f/ $ cp websocket.py examples/ $ cd examples/ $ python echo_client.py /private/tmp/liris-websocket-client-673470f/examples/websocket.py:27: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5 Traceback (most recent call last): File "echo_client.py", line 5, in ws = websocket.create_connection("ws://localhost:5000/chat") File "/private/tmp/liris-websocket-client-673470f/examples/websocket.py", line 110, in create_connection websock.connect(url, **options) File "/private/tmp/liris-websocket-client-673470f/examples/websocket.py", line 205, in connect hostname, port, resource, is_secure = _parse_url(url) File "/private/tmp/liris-websocket-client-673470f/examples/websocket.py", line 76, in _parse_url raise ValueError("hostname is invalid") ValueError: hostname is invalid The behaviour with 2.5 is identical. The distribution is from https://github.com/liris/websocket-client/zipball/v0.4.1 . |
Oh, I see the problem. The parsed hostname is broken. |
This issue was reintroduced in a recent version. Changing the Scheme back to HTTP when parsing the URL allows the library to work on 2.6.1 (I haven't tried 2.5.x). |
With Python 2.5 and 2.6, url parsing is broken because urlparse doesn't know how to interpret the
ws
scheme. Here's a fixed version that works correctly:The text was updated successfully, but these errors were encountered: