CherryPy cpstats and ws4py

Israel Brewster israel at ravnalaska.net
Wed Nov 4 15:13:00 EST 2015


Ok, let me ask a different question: the impression I have gotten when trying to find help with CherryPy in general and ws4py specifically is that these frameworks are not widely used or well supported. Is that a fair assessment, or do I just have issues that are outside the realm of experience for other users? If it is a fair assessment, should I be looking at a different product for my next project? I know there are a number of options, CherryPy was simply the first one suggested to me, and ws4py is what is listed in their docs as the framework to use for Web Sockets.

Thanks for any feedback that can be provided.
-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------


-------------- next part --------------
 

> On Nov 3, 2015, at 8:05 AM, Israel Brewster <israel at ravnalaska.net> wrote:
> 
> I posted this to the CherryPy and ws4py mailing lists, but in the week since I did that I've only gotten two or three views on each list, and no responses, so as a last-ditch effort I thought I'd post here. Maybe someone with more general python knowledge than me can figure out the traceback and from there a solution.
> 
> Is it possible to use ws4py in conjunction with the cpstats CherryPy tool? I have a CherryPy (3.8.0) web app that uses web sockets via ws4py. Tested and working. I am now trying to get a little more visibility into the functioning of the server, so to that end I enabled the cpstats tool by adding the following line to my '/' configuration:
> 
> tools.cpstats.on=True
> 
> Unfortunately, as soon as I do that, attempts to connect a web socket start failing with the following traceback:
> 
> [28/Oct/2015:08:18:48]  
> Traceback (most recent call last):
>  File "/Library/Python/2.7/site-packages/CherryPy-3.8.0-py2.7.egg/cherrypy/_cprequest.py", line 104, in run
>    hook()
>  File "/Library/Python/2.7/site-packages/CherryPy-3.8.0-py2.7.egg/cherrypy/_cprequest.py", line 63, in __call__
>    return self.callback(**self.kwargs)
>  File "build/bdist.macosx-10.10-intel/egg/ws4py/server/cherrypyserver.py", line 200, in upgrade
>    ws_conn = get_connection(request.rfile.rfile)
>  File "build/bdist.macosx-10.10-intel/egg/ws4py/compat.py", line 43, in get_connection
>    return fileobj._sock
> AttributeError: 'KnownLengthRFile' object has no attribute '_sock'
> [28/Oct/2015:08:18:48] HTTP 
> Request Headers:
>  PRAGMA: no-cache
>  COOKIE: autoTabEnabled=true; fleetStatusFilterCompany=7H; fleetStatusFilterLocation=ALL; fleetStatusRefreshInterval=5; inputNumLegs=5; session_id=5c8303896aff419c175c79dfadbfdc9d75e6c45a
>  UPGRADE: websocket
>  HOST: flbubble.ravnalaska.net:8088
>  ORIGIN: http://flbubble.ravnalaska.net
>  CONNECTION: Upgrade
>  CACHE-CONTROL: no-cache
>  SEC-WEBSOCKET-VERSION: 13
>  SEC-WEBSOCKET-EXTENSIONS: x-webkit-deflate-frame
>  USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7
>  SEC-WEBSOCKET-KEY: Szh6Uoe+WzqKR1DgW8JcXA==
>  Remote-Addr: 10.9.1.59
> [28/Oct/2015:08:18:48] HTTP 
> Traceback (most recent call last):
>  File "/Library/Python/2.7/site-packages/CherryPy-3.8.0-py2.7.egg/cherrypy/_cprequest.py", line 661, in respond
>    self.hooks.run('before_request_body')
>  File "/Library/Python/2.7/site-packages/CherryPy-3.8.0-py2.7.egg/cherrypy/_cprequest.py", line 114, in run
>    raise exc
> AttributeError: 'KnownLengthRFile' object has no attribute '_sock'
> 
> Disable tools.cpstats.on, and the sockets start working again. Is there some way I can fix this so I can use sockets as well as gather stats from my application? Thanks.
> 
> -----------------------------------------------
> Israel Brewster
> Systems Analyst II
> Ravn Alaska
> 5245 Airport Industrial Rd
> Fairbanks, AK 99709
> (907) 450-7293
> -----------------------------------------------
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list