[Zope] External Method Question
Dieter Maurer
dieter@handshake.de
Sun, 27 Jan 2002 19:15:39 +0100
Tim Owen writes:
> ... External Method ...
> >>>
>
> def valid_email(address, debug=None):
> ...
> Zope Error
> Zope has encountered an error while publishing this resource.
>
> Error Type: SyntaxError
> Error Value: invalid syntax (email_checker.py, line 1)
Apparently, you did nothing wrong. At least, it is not obvious.
But the problem must be really easy to fix:
Python is unable to parse your code. It find a syntactical
error in line 1.
I assume the ">>>" is not really in your code. If it were, this
would be the problem.
Otherwise, Python is very sensitive to indentation. Your code
must start in column 1 (when you start counting with 1).
Run the Python interpreter on your file:
python email_checker.py
If it complains about the syntax, you need to find the reason and
fix it. If not, there has been a very short lived bug in Zope
that let it have problems with "\r\n" line endings (i.e. Windows like
line endings). A Zope upgrade may remove the problem in this case.
But it is not very likely, that you have precisely this Zope version...
Dieter