[Twisted-web] exceptions.AttributeError: NevowSite instance has no attribute 'url'

Donovan Preston twisted-web@twistedmatrix.com
Tue, 23 Dec 2003 10:09:08 -0500


On Dec 23, 2003, at 9:20 AM, Justin Johnson wrote:

> After updating to the latest CVS I get errors in the attached log file
> upon the initial load of my app, which uses guard and SessionWrapper 
> for
> authentication.
>
>     portal = login.RatControlPortal(realm)
>     # Allow anonymous access.
>     portal.registerChecker(AllowAnonymousAccess(), IAnonymous)
>     # Allow users registered in the password file.
>     portal.registerChecker(FilePasswordDB(sibpath(__file__,
>     "passwords.txt")))
>
>     site = appserver.NevowSite(
>         resource=SessionWrapper(
>             UsernamePasswordWrapper(portal,
>             callback=utility.loginCallback)
>         ),
>     )
>
>
> I can try to get a tac together if needed, but the most recent changes 
> in
> CVS looked like they might have caused the problem.  Just wanted to 
> give
> you some idea of what my code looks like.

Are you using a tap? If so, you'll need to rerun mktap, as the pickled 
NevowSite in your tap won't have had the new NevowSite.__init__ called 
on it, which creates the URLGenerator which it stores as .url.

This is exactly the upgrading problem glyph is writing about in his 
blog -- how to balance the need for seamless state upgrades for old 
persistent objects with the need to keep the code simple, small and 
bugfree.

dp