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 #423 (closed defect: duplicate)

Opened 13 years ago

Last modified 12 years ago

request.app_path is not always set

Reported by: kevin Owned by: anonymous
Priority: normal Milestone: 0.9
Component: CherryPy Version:
Severity: normal Keywords:


From Rick Richardson:

When I call turbogears.url() I get this error, basically cherrypy has
not yet placed the app_path in the request object. I put a trace in the
function that sets the app_path and it does seem to call successfully
on its own. I'm not sure if it's a different request object that it is
trying to reference or what.

Page handler: <bound method Reseller.Configuration of
<eltopiacomm.reseller.Reseller instance at 0x01253E18>>
Traceback (most recent call last):
line 98, in _run
line 246, in main
   body = page_handler(*virtual_path, **self.params)
line 240, in newfunc
   html, fragment, *args, **kw)
line 189, in run_with_transaction
   retval = func(*args, **kw)
line 257, in _execute_func
   output = func(self, *args, **kw)
line 230, in _wrapper
   return fn( self, *args, **kwargs )
 File "D:\devstuff\EltopiaComm\eltopiacomm\reseller.py", line 48, in
   self.cpnydict, self.condict, self.voipdict =
 File "D:\devstuff\EltopiaComm\eltopiacomm\reseller_content.py", line
41, in createConfigDicts

line 87, in url
   if cherrypy.request.app_path != "/":
line 42, in __getattr__
   return getattr(childobject, name)
AttributeError: 'Request' object has no attribute 'app_path'


tg_bug_443_patch.patch Download (578 bytes) - added by krys@… 13 years ago.
Patch to make the problem go away.

Change History

comment:1 Changed 13 years ago by krys@…

I've been bitten by this one too.

After a lot of searching in cherrypy and turbogears, I cannot find any other reference to app_path. Are you sure that is the right variable name?

Closest thing I can find would be turbogears.startup.webpath, but the url function already uses it.

I am submitting a small patch (calid against turbogears reversion 589) which makes the problem go away, but I do not know if it is the *best* solution.

Anyway, hope it helps.


Changed 13 years ago by krys@…

Patch to make the problem go away.

comment:2 Changed 13 years ago by krys@…

Oops, wrong ticket number in the patch file name. The patch is good though.

comment:3 Changed 13 years ago by krys@…

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

This was also reported on #466 and seems to be fixed in revision r599.

Note: See TracTickets for help on using tickets.