Re: [CherryPy] #873: Update RoutesDispatcher to handle RESTful URL requests

5 views
Skip to first unread message

CherryPy

unread,
Feb 13, 2009, 11:23:40 AM2/13/09
to cherrypy...@googlegroups.com
#873: Update RoutesDispatcher to handle RESTful URL requests
---------------------------+------------------------------------------------
Reporter: delagoya | Owner: fumanchu
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: CherryPy code | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Comment (by guest):

This does indeed appear to cause a problem in cherrypy-3.1.1:

{{{
Traceback (most recent call last):
File "/usr/lib/python2.5/site-
packages/CherryPy-3.1.1-py2.5.egg/cherrypy/_cprequest.py", line 600, in
respond
self.process_body()
File "/usr/lib/python2.5/site-
packages/CherryPy-3.1.1-py2.5.egg/cherrypy/_cprequest.py", line 718, in
process_body
keep_blank_values=1)
File "/usr/lib/python2.5/site-
packages/CherryPy-3.1.1-py2.5.egg/cherrypy/_cpcgifs.py", line 8, in
__init__
cgi.FieldStorage.__init__(self, *args, **kwds)
File "/usr/lib/python2.5/cgi.py", line 532, in __init__
self.read_urlencoded()
File "/usr/lib/python2.5/cgi.py", line 637, in read_urlencoded
qs = self.fp.read(self.length)
File "/usr/lib/python2.5/site-
packages/CherryPy-3.1.1-py2.5.egg/cherrypy/wsgiserver/__init__.py", line
199, in read
data = self.rfile.read(size)
File "/usr/lib/python2.5/site-
packages/CherryPy-3.1.1-py2.5.egg/cherrypy/wsgiserver/__init__.py", line
791, in read
data = self.recv(left)
File "/usr/lib/python2.5/site-
packages/CherryPy-3.1.1-py2.5.egg/cherrypy/wsgiserver/__init__.py", line
747, in recv
return self._sock.recv(size)
timeout: timed out
}}}

--
Ticket URL: <http://www.cherrypy.org/ticket/873>
CherryPy <http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework

CherryPy

unread,
Feb 16, 2009, 5:08:37 AM2/16/09
to cherrypy...@googlegroups.com
#873: Update RoutesDispatcher to handle RESTful URL requests
---------------------------+------------------------------------------------
Reporter: delagoya | Owner: fumanchu
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: CherryPy code | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Comment (by guest):

Correction: It still works with fastcgi.

CherryPy

unread,
Apr 1, 2009, 3:05:58 PM4/1/09
to cherrypy...@googlegroups.com
#873: Update RoutesDispatcher to handle RESTful URL requests
---------------------------+------------------------------------------------
Reporter: delagoya | Owner: lawouach
Type: enhancement | Status: assigned
Priority: low | Milestone:
Component: CherryPy code | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Changes (by lawouach):

* owner: fumanchu => lawouach
* priority: normal => low
* status: new => assigned

Comment:

Personally I would rather see this on the tools wiki and not add more
semantic to the current Routes dispatcher.

CherryPy

unread,
May 16, 2009, 11:03:00 PM5/16/09
to cherrypy...@googlegroups.com
#873: Update RoutesDispatcher to handle RESTful URL requests
---------------------------+------------------------------------------------
Reporter: delagoya | Owner: lawouach
Type: enhancement | Status: assigned
Priority: low | Milestone:
Component: CherryPy code | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Comment (by jroesslein):

Here is a patch that fixes this issue. Also controllers are now loaded
when needed.
When mapping the controller class, not object, should be provided.

CherryPy

unread,
May 16, 2009, 11:09:13 PM5/16/09
to cherrypy...@googlegroups.com
#873: Update RoutesDispatcher to handle RESTful URL requests
---------------------------+------------------------------------------------
Reporter: delagoya | Owner: lawouach
Type: enhancement | Status: assigned
Priority: low | Milestone:
Component: CherryPy code | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Comment (by jroesslein):

Opps forgot the patch.

[http://pastebin.ca/1425103]

CherryPy

unread,
May 19, 2009, 4:07:37 AM5/19/09
to cherrypy...@googlegroups.com
#873: Update RoutesDispatcher to handle RESTful URL requests
---------------------------+------------------------------------------------
Reporter: delagoya | Owner: lawouach
Type: enhancement | Status: assigned
Priority: low | Milestone:
Component: CherryPy code | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Comment (by lawouach):

Which issue does the patch fix? The original post was about making the
RoutesDispatcher based on the HTTP method, I don't see how the attached
patch does that.

In any case, I'm really not a big fan of lazy object creation without some
sort of caching and I'm even less happy with a cache on the dispatcher.

I'm also wondering if lazy object creation actually improves performances
overall. I'd like more input to make a decision but as it stands I doubt
it's a good idea.

--
Ticket URL: <http://cherrypy.org/ticket/873>

CherryPy

unread,
Oct 28, 2009, 3:03:48 PM10/28/09
to cherrypy...@googlegroups.com
#873: Update RoutesDispatcher to handle RESTful URL requests
---------------------------+------------------------------------------------
Reporter: delagoya | Owner: lawouach
Type: enhancement | Status: assigned
Priority: low | Milestone:
Component: CherryPy code | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Comment (by delagoya):

Hi all. I want to close this issue. The default RoutesDispatcher is fine.
You can use wsgi middleware to set REQUEST_METHOD from a form "_method"
hidden input. I think this would be a better way to go.

CherryPy

unread,
Nov 1, 2009, 10:46:17 AM11/1/09
to cherrypy...@googlegroups.com
#873: Update RoutesDispatcher to handle RESTful URL requests
---------------------------+------------------------------------------------
Reporter: delagoya | Owner: lawouach
Type: enhancement | Status: closed
Priority: low | Milestone:
Component: CherryPy code | Resolution: toolfix
Keywords: |
---------------------------+------------------------------------------------
Changes (by fumanchu):

* resolution: => toolfix
* status: assigned => closed
Reply all
Reply to author
Forward
0 new messages