On Sep 6, 2007, at 2:28 PM, Mike Orr wrote:

>
> I have an application with an initialization function called from
> environment.py, which uses url_for.  This worked fine in earlier svn
> versions of Pylons 0.9.6, but with rc3 and Routes 1.7 I get:
>
>   File "/usr/local/lib/python2.5/site-packages/Routes-1.7-py2.5.egg/ 
> routes/__init__.py",
> line 14, in __getattr__
>     return getattr(self.__shared_state, name)
> AttributeError: 'thread._local' object has no attribute 'mapper'
>
>
> At first i thought it was using the old syntax for accessing the
> Pylons config.  But it looks like it's a distinct Routes config object
> that hasn't been initialized properly.  Either that or Pylons is
> setting routes config.mapper later than it used to.  Any ideas?
>

This is probably due to routes being configured after G is initialized:

     config['pylons.g'] = app_globals.Globals()
     config['pylons.h'] = ${package}.lib.helpers
     config['routes.map'] = make_map()

Try moving the make_map line before Globals(). The default template  
should probably do the same.

--
Philip Jenvey



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to