Message321010
Changing the urlopen call to a curl commnand invoke works.
$ export http_proxy=socks5://127.0.0.1:8888 https_proxy=socks5://127.0.0.1:8888
# this will raise an exception with string representation is a blank string
# at least for url: https://s3.amazonaws.com/mozilla-games/emscripten/packages/llvm/tag/linux_64bit/emscripten-llvm-e1.37.35.tar.gz
from urllib2 import urlopen, HTTPError
u = urlopen(url)
mkdir_p(os.path.dirname(file_name))
with open(file_name, 'wb') as f:
file_size = get_content_length(u)
if file_size > 0: print("Downloading: %s from %s, %s Bytes" % (file_name, url, file_size))
else: print("Downloading: %s from %s" % (file_name, url))
file_size_dl = 0
block_sz = 8192
while True:
buffer = u.read(block_sz)
if not buffer:
break
file_size_dl += len(buffer)
f.write(buffer)
# this alternative way works
import commands
status, output = commands.getstatusoutput("curl -L --output " + file_name + " " + url) |
|
Date |
User |
Action |
Args |
2018-07-04 04:33:55 | T L2 | set | recipients:
+ T L2 |
2018-07-04 04:33:55 | T L2 | set | messageid: <1530678835.56.0.56676864532.issue34038@psf.upfronthosting.co.za> |
2018-07-04 04:33:55 | T L2 | link | issue34038 messages |
2018-07-04 04:33:54 | T L2 | create | |
|