unbound method error with ZPT
Everything used to work fine but now I get a weird error message in my METAL macros Page Template. <!-- Page Template Diagnostics Compilation failed exceptions.TypeError: unbound method must be called with class instance 1st argument --> No line number, so I started removing things until I came to an odd conclusion. That this does NOT work: <html metal:define-macro="standard"> <br tal:replace="python:here.APythonScript()" /> </html> BUT, this works: <html metal:define-macro="standard"> <br tal:replace="here/APythonScript"/> </html> Zope 2.3.2, python 1.5.2, win98 TAL, PageTemplates 1.4.(latest) I have searched the mailinglist but found no solution. It was working before until the site got complicated. I suppose I should be more specific about the whole problem but I was hoping for a quick answer. Has anybody come across this; and solved it?? Cheers, Peter
Peter Bengtsson writes:
Everything used to work fine but now I get a weird error message in my METAL macros Page Template.
<!-- Page Template Diagnostics Compilation failed exceptions.TypeError: unbound method must be called with class instance 1st argument -->
No line number, so I started removing things until I came to an odd conclusion. That this does NOT work:
<html metal:define-macro="standard"> <br tal:replace="python:here.APythonScript()" /> </html>
BUT, this works: <html metal:define-macro="standard"> <br tal:replace="here/APythonScript"/> </html> Fortunately, this is not a general problem! I use lots of "here.APythonScript()" that work perfectly.
The code, you show us, should not affect compilation at all as the "tal:replace" attributes are not evaluated during compilation... If your problem is reproducible with a few objects, you can send me a zexp, tar or zip archive and I, too, will try to reproduce the problem. Dieter
Everything used to work fine but now I get a weird error message in my METAL macros Page Template.
<!-- Page Template Diagnostics Compilation failed exceptions.TypeError: unbound method must be called with class instance 1st argument -->
No line number, so I started removing things until I came to an odd conclusion. That this does NOT work:
<html metal:define-macro="standard"> <br tal:replace="python:here.APythonScript()" /> </html>
BUT, this works: <html metal:define-macro="standard"> <br tal:replace="here/APythonScript"/> </html> Fortunately, this is not a general problem! I use lots of "here.APythonScript()" that work perfectly.
The code, you show us, should not affect compilation at all as the "tal:replace" attributes are not evaluated during compilation...
Interestingly, after restarting the server the problem went away. I left work and turned off the computer with a troubled mind and the next morning the error was gone! I just left it at that. Obviously this was irrational and caused by some bug somewhere (most likely caused by the complexity of my site in some strange way). Now it works and I have not seen it since. Unfortunatly I don't have time enough on my project to look into it. Thank you for your help, Peter
Peter Bengtsson writes:
Interestingly, after restarting the server the problem went away. I left work and turned off the computer with a troubled mind and the next morning the error was gone! Zope 2.4.3 (or below) or Python 2.1.1 (or below)?
I have seen such installations do arbitrary weird things. Dieter
At 14:35 2002-03-02 +0100, Dieter Maurer wrote:
Peter Bengtsson writes:
Interestingly, after restarting the server the problem went away. I left work and turned off the computer with a troubled mind and the next morning the error was gone! Zope 2.4.3 (or below) or Python 2.1.1 (or below)?
Zope 2.3.2, Python 1.5.2 I instinctivly blame it on Windows 98 :)
I have seen such installations do arbitrary weird things.
Dieter
participants (2)
-
Dieter Maurer -
Peter Bengtsson