[Zope] problem with python method as ftp client
rayprice2001
rprice@collegenet.com
Thu, 17 Jan 2002 00:38:12 -0000
Hi,
I am trying to run a python method from within zope 2.4.3 and I'm
getting an error. Is is possible to have a python method act as an
ftp client? The script runs just fine when I run it from command
line. It appears to be failing on the "from ftplib import FTP" line.
Any ideas as to what the problem may be? Code and error are below.
Ray
script GetCourse:
########get the file from the ftp server
from ftplib import FTP
DATA=FTP("www.myservermame.com")
ftp.login("me","xxxxx5")
print ftp.retrlines("RETR classlist.txt")
ftp.close()
##########
Error:
<!--
Traceback (innermost last):
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 223, in
publish_module
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 187, in
publish
File /usr/local/Zope/lib/python/Zope/__init__.py, line 226, in
zpublisher_exception_hook
(Object: classlist)
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 171, in
publish
File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: R25_DataPrep)
File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: R25_DataPrep)
File /usr/local/Zope/lib/python/OFS/DTMLMethod.py, line 199, in
__call__
(Object: R25_DataPrep)
File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line
546, in __call__
(Object: R25_DataPrep)
File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line
231, in eval
(Object: GetCourse(COURSE='R25DP'))
(Info: GetCourse)
File <string>, line 2, in f
File /usr/local/Zope/lib/python/Shared/DC/Scripts/Bindings.py, line
324, in __call__
(Object: GetCourse)
File /usr/local/Zope/lib/python/Shared/DC/Scripts/Bindings.py, line
354, in _bindAndExec
(Object: GetCourse)
File
/usr/local/Zope/lib/python/Products/PythonScripts/PythonScript.py,
line 363, in _exec
(Object: GetCourse)
(Info: ({'script': <PythonScript instance at 88e8768>, 'context':
<Folder instance at 8877070>, 'container': <Folder instance at
8877070>, 'traverse_subpath': []}, (), {'COURSE': 'R25DP'},
('R25DP',)))
File Script (Python), line 8, in GetCourse
File /usr/local/Zope/lib/python/AccessControl/ZopeGuards.py, line
213, in guarded_import
ImportError: (see above)
-->