Skip to content
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

echo_cherrypy_server with Python 3.2 fails on client connection #62

Closed
v-legoff opened this issue Oct 31, 2012 · 0 comments
Closed

echo_cherrypy_server with Python 3.2 fails on client connection #62

v-legoff opened this issue Oct 31, 2012 · 0 comments

Comments

@v-legoff
Copy link

When launching the 'echo_cherrypy_server.py' example, the CherryPy server starts, but the client connection fails with a TypeError.

To reproduce:

  1. Launch the 'echo_cherrypy_server.py' example with Python 3.2 [1]
  2. Open a compatible browser (Mozilla Firefox 16 in my case) and go to the URL: http://localhost:9000
  3. On the server-side (Python console), the following error occurs:

[31/Oct/2012:10:40:14] HTTP
Request Headers:
PRAGMA: no-cache
UPGRADE: websocket
HOST: 127.0.0.1:9000
ORIGIN: http://localhost:9000
CONNECTION: keep-alive, Upgrade
CACHE-CONTROL: no-cache
SEC-WEBSOCKET-VERSION: 13
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
USER-AGENT: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/16.0
ACCEPT-LANGUAGE: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
SEC-WEBSOCKET-KEY: 6mxn50NE+8xKZ15w2/NQRw==
Remote-Addr: 127.0.0.1
ACCEPT-ENCODING: gzip, deflate
[31/Oct/2012:10:40:14] HTTP Traceback (most recent call last):
File "C:\python32\lib\site-packages\cherrypy-3.2.2-py3.2.egg\cherrypy_cprequest.py", line 647, in respond
self.hooks.run('before_request_body')
File "C:\python32\lib\site-packages\cherrypy-3.2.2-py3.2.egg\cherrypy_cprequest.py", line 112, in run
raise exc
File "C:\python32\lib\site-packages\cherrypy-3.2.2-py3.2.egg\cherrypy_cprequest.py", line 102, in run
hook()
File "C:\python32\lib\site-packages\cherrypy-3.2.2-py3.2.egg\cherrypy_cprequest.py", line 62, in call
return self.callback(**self.kwargs)
File "C:\python32\lib\site-packages\ws4py-0.2.3-py3.2.egg\ws4py\server\cherrypyserver.py", line 149, in upgrade
ws_key = base64.b64decode(key)
File "C:\python32\lib\base64.py", line 83, in b64decode
raise TypeError("expected bytes, not %s" % s.class.name)
TypeError: expected bytes, not str

127.0.0.1 - - [31/Oct/2012:10:40:14] "GET /ws HTTP/1.1" 500 1686 "" "Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/16.0"

[1] Windows 7, Python 3.2.3, CherryPy 3.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants