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:

Traceback (most recent call last):
  File "/usr/local/bin/paster", line 8, in <module>
    load_entry_point('PasteScript==1.3.6dev-r6893', 'console_scripts',
'paster')()
  File 
"/usr/local/lib/python2.5/site-packages/PasteScript-1.3.6dev_r6893-py2.5.egg/paste/script/command.py",
line 78, in run
    invoke(command, command_name, options, args[1:])
  File 
"/usr/local/lib/python2.5/site-packages/PasteScript-1.3.6dev_r6893-py2.5.egg/paste/script/command.py",
line 117, in invoke
    exit_code = runner.run(args)
  File 
"/usr/local/lib/python2.5/site-packages/PasteScript-1.3.6dev_r6893-py2.5.egg/paste/script/command.py",
line 212, in run
    result = self.command()
  File 
"/usr/local/lib/python2.5/site-packages/PasteScript-1.3.6dev_r6893-py2.5.egg/paste/script/serve.py",
line 227, in command
    relative_to=base, global_conf=vars)
  File 
"/usr/local/lib/python2.5/site-packages/PasteScript-1.3.6dev_r6893-py2.5.egg/paste/script/serve.py",
line 250, in loadapp
    **kw)
  File 
"/usr/local/lib/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py",
line 193, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File 
"/usr/local/lib/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py",
line 214, in loadobj
    return context.create()
  File 
"/usr/local/lib/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py",
line 606, in create
    return self.object_type.invoke(self)
  File 
"/usr/local/lib/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py",
line 99, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File 
"/usr/local/lib/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/util/fixtypeerror.py",
line 57, in fix_call
    val = callable(*args, **kw)
  File "/home/mso/svn/hazweb/inews/inews/config/middleware.py", line
39, in make_app
    load_environment(global_conf, app_conf)
  File "/home/mso/svn/hazweb/inews/inews/config/environment.py", line
37, in load_environment
    config['pylons.g'] = app_globals.Globals()
  File "/home/mso/svn/hazweb/inews/inews/lib/app_globals.py", line 18,
in __init__
    config["glossary.pickle_file"])
  File "/home/mso/svn/hazweb/inews/inews/lib/glossary.py", line 105,
in get_glossary
    _glossary = make_glossary(html_file)
  File "/home/mso/svn/hazweb/inews/inews/lib/glossary.py", line 117,
in make_glossary
    _fix_definitions(terms)
  File "/home/mso/svn/hazweb/inews/inews/lib/glossary.py", line 183,
in _fix_definitions
    a["href"] = url_for("glossary", page=letter, anchor=link_id)
  File 
"/usr/local/lib/python2.5/site-packages/Routes-1.7-py2.5.egg/routes/util.py",
line 141, in url_for
    encoding = config.mapper.encoding
  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?

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
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