problems with adding monthRange.py as Python script object
I am trying to add the monthRange.py Python script into a Zope folder. I get the following traceback that looks like Zope's having trouble finding DateTime. DateTime is definitely there and compiled o.k. (pyc files are present) Any ideas? I am running Zope 2.3.2 and CMF 1.1beta on a Windows ME machine at home. What's with the empty string after the File in the message below? Is that part of the problem? Thanks for any hints. File "", line 2 from DateTime import DateTime ^ SyntaxError: invalid syntax Traceback (innermost last): File C:\Program Files\EmanuEl\lib\python\ZPublisher\Publish.py, line 223, in publish_module File C:\Program Files\EmanuEl\lib\python\ZPublisher\Publish.py, line 187, in publish File C:\Program Files\EmanuEl\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook File C:\Program Files\EmanuEl\lib\python\ZPublisher\Publish.py, line 171, in publish File C:\Program Files\EmanuEl\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: manage_addPythonScript) File C:\Program Files\EmanuEl\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: manage_addPythonScript) File C:\Program Files\EmanuEl\lib\python\Products\PythonScripts\PythonScript.py, line 124, in manage_addPythonScript File C:\Program Files\EmanuEl\lib\python\Products\PythonScripts\PythonScript.py, line 443, in write (Object: monthRange) File C:\Program Files\EmanuEl\lib\python\Products\PythonScripts\PythonScript.py, line 283, in _makeFunction (Object: monthRange) Python Script Error: (see above)Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Frank McGeough writes:
I get the following traceback that looks like Zope's having trouble finding DateTime.
File "", line 2
from DateTime import DateTime
^
SyntaxError: invalid syntax Zope does not have a problem to find "DateTime". It reports a SyntaxError not an ImportError.
There may be something invisible after the "DateTime" that confuses the Python parser. Maybe, the indentation is wrong. You know, Python block structuring is based on indentation (I hate that but others are convinced, it is a major strength). One missing space or one to much, and you get a difficult to recognize syntax error. Dieter
participants (2)
-
Dieter Maurer -
Frank McGeough