Actually, this piece of code seems to work fine
# Get our proxy settings from the environment
proxies = {}
try:
for proto in ('http','https','ftp'):
try:
proxies[proto] = os.environ[proto+"_proxy"]
except KeyError:
pass
print proxies # my code
if proxies:
urllib._urlopener = urllib.FancyURLopener(proxies)
except Exception:
and then the urllib.urlretrieve should work, and it does when run manually, but somehow not from the cron job. I can't see why.
Actually, this piece of code seems to work fine ,'https' ,'ftp') : proto+" _proxy" ]
# Get our proxy settings from the environment
proxies = {}
try:
for proto in ('http'
try:
proxies[proto] = os.environ[
except KeyError:
pass
print proxies # my code
if proxies: _urlopener = urllib. FancyURLopener( proxies)
urllib.
except Exception:
and then the urllib.urlretrieve should work, and it does when run manually, but somehow not from the cron job. I can't see why.