[Zope] urlretrieve...strange behaviour
belen@netcom.no
belen@netcom.no
Thu, 12 Jul 2001 14:39:50 +0100
Hello,
I have a very strange problem. I have a method that does at follows
import urllib
def storepages(base, TestIds):
for testid in TestIds:
url=base+testid
try:
urllib.urlretrieve
(url, 'c:\Zope\BelenSite\images\Doc'+testid+'.html')
finally:
urllib.urlcleanup()
If I run it through the DOS promt it works perfectly. It fetches some
URLs, stores them where I say, and clears the local cache. If I try to
use it as an external method in zope it does not work at all. Zope
hangs...It hangs when executing this line
>>> urllib.urlretrieve
(url, 'c:\Zope\BelenSite\images\Doc'+testid+'.html').
I have tried urllib.urlopen(url) instead but it cannot be opened either
I have created an alternative external method to test more. This one
does not iterate through any list...I pass a single parameter and works
to my surprise this works really fine.
import urllib
def storepage(base, TestIds):
url=base+TestIds
try:
urllib.urlretrieve
(url, 'c:\Zope\BelenSite\images\Doc'+TestIds+'.html')
finally:
urllib.urlcleanup()
The only difference it is that instead of working with a list I pass a
string. And this seems to be all about. Am I right ? Wrong? Can any one
see anything terrible?
Some help would be really appreciated. Thaks a lot.
Belen