New submission from Rob Weir <rw...@ertius.org>:

e.g. configure this function definition, via ZCML, as a view
def my_view(request, context):
    return {'project':'foo'}

causes this exception:
Traceback (most recent call last):
  File "/home/rob/scratch/bfgenv/bin/paster", line 8, in <module>
    load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteScript-1.7.3-
py2.5.egg/paste/script/command.py", line 84, in run
    invoke(command, command_name, options, args[1:])
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteScript-1.7.3-
py2.5.egg/paste/script/command.py", line 123, in invoke
    exit_code = runner.run(args)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteScript-1.7.3-
py2.5.egg/paste/script/command.py", line 218, in run
    result = self.command()
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteScript-1.7.3-
py2.5.egg/paste/script/serve.py", line 276, in command
    relative_to=base, global_conf=vars)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteScript-1.7.3-
py2.5.egg/paste/script/serve.py", line 313, in loadapp
    **kw)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteDeploy-1.3.3-
py2.5.egg/paste/deploy/loadwsgi.py", line 204, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteDeploy-1.3.3-
py2.5.egg/paste/deploy/loadwsgi.py", line 225, in loadobj
    return context.create()
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteDeploy-1.3.3-
py2.5.egg/paste/deploy/loadwsgi.py", line 625, in create
    return self.object_type.invoke(self)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteDeploy-1.3.3-
py2.5.egg/paste/deploy/loadwsgi.py", line 110, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/PasteDeploy-1.3.3-
py2.5.egg/paste/deploy/util/fixtypeerror.py", line 57, in fix_call
    val = callable(*args, **kw)
  File "/home/rob/scratch/bfgenv/foo/foo/run.py", line 13, in app
    config.load_zcml(zcml_file)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/repoze.bfg-1.2-
py2.5.egg/repoze/bfg/configuration.py", line 439, in load_zcml
    xmlconfig.file(filename, package, execute=True)
  File 
"/home/rob/scratch/bfgenv/lib/python2.5/site-packages/zope.configuration-3.7.1-
py2.5.egg/zope/configuration/xmlconfig.py", line 653, in file
    context.execute_actions()
  File 
"/home/rob/scratch/bfgenv/lib/python2.5/site-packages/zope.configuration-3.7.1-
py2.5.egg/zope/configuration/config.py", line 606, in execute_actions
    callable(*args, **kw)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/repoze.bfg-1.2-
py2.5.egg/repoze/bfg/zcml.py", line 203, in register
    _info=_context.info)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/repoze.bfg-1.2-
py2.5.egg/repoze/bfg/configuration.py", line 733, in add_view
    renderer, wrapper, name, accept, score)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/repoze.bfg-1.2-
py2.5.egg/repoze/bfg/configuration.py", line 215, in _derive_view
    mapped_view = _map_view(view, attr, renderer, renderer_name)
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/repoze.bfg-1.2-
py2.5.egg/repoze/bfg/configuration.py", line 1674, in _map_view
    elif requestonly(view, attr):
  File "/home/rob/scratch/bfgenv/lib/python2.5/site-packages/repoze.bfg-1.2-
py2.5.egg/repoze/bfg/configuration.py", line 1627, in requestonly
    if len(args) - len(defaults) == 1:
zope.configuration.config.ConfigurationExecutionError: <type 
'exceptions.TypeError'>: 
object of type 'NoneType' has no len()
  in:
  File "/home/rob/scratch/bfgenv/foo/foo/configure.zcml", line 6.2-10.7
    <view
       context=".models.MyModel"
       view=".views.my_view"
       renderer="templates/mytemplate.pt"
       />

----------
messages: 380
nosy: rweir
priority: bug
status: unread
title: reversing the arg names of two-arg view callables causes a weird 
exception

__________________________________
Repoze Bugs <b...@bugs.repoze.org>
<http://bugs.repoze.org/issue140>
__________________________________
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to