Commit 043bc0eb authored by Ask Hjorth Larsen's avatar Ask Hjorth Larsen

py3 fix: non-strictly decode bytes from url as ascii in install_data. Closes: #130

parent 6d131bc5
Pipeline #17206105 passed with stage
in 4 minutes and 31 seconds
......@@ -244,12 +244,14 @@ def get_urls(source):
r'(sg15_oncv_upf_\d\d\d\d-\d\d-\d\d.tar.gz)'
r'\s*</a>')
files = re.compile(pattern).findall(response.read())
txt = response.read().decode('ascii', errors='replace')
files = re.compile(pattern).findall(txt)
files.sort(reverse=True)
urls = [page + fname for fname in files]
elif source == 'basis':
pattern = re.compile('>(gpaw-basis-.+?.tar.gz)</a>')
files = sorted(pattern.findall(response.read()), reverse=True)
txt = response.read().decode('ascii', errors='replace')
files = sorted(pattern.findall(txt), reverse=True)
urls = [page + fname for fname in files]
elif source == 'test':
urls = ['{0}gpaw-dist-test-source.tar.gz'.format(page)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment