pure WSGI apps on the tree don't really work

Christian Wyglendowski avatarChristian Wyglendowski created an issue

This problem is masked in the test suite by the sync_apps function in test/helper.py. It grabs WSGI callables from the tree and directly attaches them at various "SCRIPT_NAME" mount points in _cpwsgiserver, which is not a common occurrence in a standard CP app.

Running test/test_wsgiapps.py standalone (not test.py --test_wsgiapps) reveals the problem.

Traceback (most recent call last):
  File "C:\Python24\lib\site-packages\cherrypy\_cprequest.py", line 181, in run
    self.respond(pi)
  File "C:\Python24\lib\site-packages\cherrypy\_cprequest.py", line 220, in respond
    self.get_resource(path_info)
  File "C:\Python24\lib\site-packages\cherrypy\_cprequest.py", line 310, in get_resource
    dispatch(path)
  File "C:\Python24\lib\site-packages\cherrypy\_cprequest.py", line 447, in __call__
    func, vpath = self.find_handler(path_info)
  File "C:\Python24\lib\site-packages\cherrypy\_cprequest.py", line 460, in find_handler
    root = app.root
AttributeError: 'function' object has no attribute 'root'

_cptree.Tree.__call__ should dispatch to the individual WSGI applications in the tree, not just to the _cpwsgi._wsgi_callable, which itself tries to dispatch to CP applications.

Comments (2)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.