[Repoze-dev] [issue140] reversing the arg names of two-arg view callables causes a weird exception

2013-12-17 Thread Tres Seaver

Tres Seaver  added the comment:

Please report / track Pyramid issues on Github:

  https://github.com/Pylons/pyramid/issues

--
status: in-progress -> deferred

__
Repoze Bugs 

__
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
https://lists.repoze.org/mailman/listinfo/repoze-dev


[Repoze-dev] [issue140] reversing the arg names of two-arg view callables causes a weird exception

2010-03-09 Thread Chris McDonough

Chris McDonough  added the comment:

Sorry, I chatted with rweir about this; the bugreport was about the opacity of 
the traceback when 
the args are reversed; he knows that he reversed the args.

--
status: resolved -> in-progress

__
Repoze Bugs 

__
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] [issue140] reversing the arg names of two-arg view callables causes a weird exception

2010-03-09 Thread Tres Seaver

Tres Seaver  added the comment:

Your view function should us either the "context, request" calling convention::

  def my_view(context, request):
  return {'project':'foo'}

or the "request only" calling convention:

  def my_view(request):
  return {'project':'foo'}

See http://docs.repoze.org/bfg/1.2/narr/views.html#view-callables

--
status: unread -> resolved

__
Repoze Bugs 

__
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] [issue140] reversing the arg names of two-arg view callables causes a weird exception

2010-03-08 Thread Rob Weir

New submission from Rob Weir :

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 
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: : 
object of type 'NoneType' has no len()
  in:
  File "/home/rob/scratch/bfgenv/foo/foo/configure.zcml", line 6.2-10.7


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

__
Repoze Bugs 

__
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev