[Zope] External Method Question

Tim Owen timowen@voyager.net
Sun, 27 Jan 2002 13:48:04 -0500


Well, it was my bonehead mistake - of course.

Turns out that the file was corrupted with binary characters.  I had used
Wordpad in text mode to edit and save the file and it did not save properly.
Found this when I opened it in PythonWin. The interpreter now has no issues
with the file.  I could create the external method and call it.

Thanks for your assistance.

----- Original Message -----
From: "Dieter Maurer" <dieter@handshake.de>
To: "Tim Owen" <timowen@voyager.net>
Cc: <zope@zope.org>
Sent: Sunday, January 27, 2002 1:15 PM
Subject: Re: [Zope] External Method Question


> 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
>