[Zope-dev] bug in mapply.py?

Tim Hicks tim@sitefusion.co.uk
Tue, 5 Nov 2002 14:23:01 -0000 (GMT)


Hi all,

I've been trying to track down the problem outlined here *:
http://zope.nipltd.com/public/lists/zope-archive.nsf/ByKey/B9323F6D666D3D5C

I got a traceback (see below), that indicates that the problem occurs when
mapply.py inspects my method.

I must admit to not understanding why this should only break over xmlrpc
and not directly from Zope.  The problem appears to be that my method is
defined something like:

def method(self, *args, **kw)

As far as I can tell, this means that co_argcount is 1, which makes
'names' == [self,].  Passing in positional arguments to the method then
fails as len(positional) > len(names).  (All this is taken from around
line 54 of mapply.py)

Well, that seems to be why my code fails.  Can anyone tell me either what
I'm doing wrong or tell me I've found a bug.  The latter seems pretty
unlikely I would think - I'm assuming this code has been around and
working for quite a while now.

cheers,

tim

'File "D:\\Zlave\\zope251\\lib\\python\\ZPublisher\\Publish.py", line 150,
in publish_module\n    response = publish(request, module_name,
after_list, debug=debug)',
'File "D:\\Zlave\\zope251\\lib\\python\\Products\\Localizer\\__init__.py",
line 65, in new_publish\n    mapply)',
'File "D:\\Zlave\\zope251\\lib\\python\\ZPublisher\\Publish.py", line 114,
in publish\n    sys.exc_info()[2],',
'File "D:\\Zlave\\zope251\\lib\\python\\Zope\\__init__.py", line 159, in
zpublisher_exception_hook\n    f(client, REQUEST, t, v, traceback)',
'File "D:\\Zlave\\zope251\\lib\\python\\ZPublisher\\Publish.py", line 98,
in publish\n    request, bind=1)',
'File "D:\\Zlave\\zope251\\lib\\python\\ZPublisher\\mapply.py", line 69,
in mapply\n    if len(positional) > nargs: raise TypeError, \'too many
arguments\'

* One final unrelated point.  I was only able to get this far by hacking
at ZPublisher/xmlrpc.py so that def exception(self...) appended the
'server-side' traceback to the faultString that is returned to the client.
 This seems like a *very* useful feature.  Any chance of this getting
implemented?