Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #633 (closed defect: worksforme)

Opened 13 years ago

Last modified 12 years ago

Comment on docs/gettingstarted.html

Reported by: Kylotan@… Owned by: anonymous
Priority: normal Milestone: 1.0b2
Component: Documentation Version:
Severity: minor Keywords: migrate


The example says:

Error!	This method is not exposed.
CherryPy will only navigate to exposed methods.

Yet CherryPy? does navigate there, giving this response:

The next parts were ('add', 'cantgohere')

Build time: 0.000s, Page size: 0.04KB

So the getting started page has a bit of an error, and what looks like a bit of a security issue (although it probably isn't really).

Change History

comment:1 Changed 13 years ago by simon

What CherryPy? displays is the default page (defined on line 37 in Getting Started), which is used when no other (better) match is found.

comment:2 Changed 13 years ago by kylotan@…

Yeah, I know what it displays, but that doesn't alter the fact that the TurboGears documentation is completely wrong as to what will get displayed and what CherryPy? will do in response to that URL.

comment:3 Changed 13 years ago by jorge.vargas

  • Status changed from new to closed
  • Resolution set to invalid

as simon said

154 @turbogears.expose() 155 def default(self, *args): 156 return "The next parts were %s" % str(args)

so cherryPy isn't going there,

closed as invalid

comment:4 Changed 13 years ago by Kylotan

  • Status changed from closed to reopened
  • Resolution invalid deleted

There seems to be a clear misunderstanding here.

The doc page in questions clearly states that "What you See" is "Error!", and that 'CherryPy? will only navigate to exposed methods.'

This is not the case, with either 0.8.9 or the latest alpha.

Instead, what you see is "The next parts were ('add', 'cantgohere')". It may be true that CherryPy? is not accessing the cantgohere method, but there is certainly no 'error' and CherryPy? is certainly returning something, which is not what is implied by the documentation. In fact, it returns the same sort of response as the last two examples in that table in the docs, which do not make any mention of 'error'. The result is not an error at all.

comment:5 Changed 13 years ago by jorge.vargas

  • Keywords migrate added
  • Milestone set to 1.0b2

comment:6 Changed 13 years ago by jorge.vargas

  • Status changed from reopened to closed
  • Resolution set to worksforme
404 Not Found

The path '/add/cantgohere' was not found.

Page handler: "The path '/add/cantgohere' was not found."
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 105, in _run
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 246, in main
    page_handler, object_path, virtual_path = self.mapPathToObject(path)
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 312, in mapPathToObject
    raise cherrypy.NotFound(objectpath)
NotFound: 404

comment:7 Changed 13 years ago by Kylotan

May I ask, has this been closed because the documentation has been changed, or because the behaviour has been changed? The example that caused this error is no longer in the official docs, therefore although it may be true that this particular ticket can be closed, I can't test the actual problem to see if the behaviour is fixed or not. This sort of URL handling appears to have been removed from the Getting Started guide altogether, which is a shame.

Note: See TracTickets for help on using tickets.