mirror of
https://github.com/simon987/od-database.git
synced 2025-04-20 10:56:47 +00:00
Bugfix post-pycurl update pt. 2
This commit is contained in:
parent
484a0baf9d
commit
6ffc43601b
@ -162,6 +162,8 @@ class HttpDirectory(RemoteDirectory):
|
|||||||
handles = [self._curl_handle() for _ in range(len(urls_to_request))]
|
handles = [self._curl_handle() for _ in range(len(urls_to_request))]
|
||||||
files = pool.starmap(self._request_file, zip(handles, urls_to_request, repeat(self.base_url)))
|
files = pool.starmap(self._request_file, zip(handles, urls_to_request, repeat(self.base_url)))
|
||||||
pool.close()
|
pool.close()
|
||||||
|
for handle in handles:
|
||||||
|
handle.close()
|
||||||
for file in files:
|
for file in files:
|
||||||
if file:
|
if file:
|
||||||
yield file
|
yield file
|
||||||
@ -186,7 +188,6 @@ class HttpDirectory(RemoteDirectory):
|
|||||||
stripped_url = url[len(base_url) - 1:]
|
stripped_url = url[len(base_url) - 1:]
|
||||||
headers = HttpDirectory._parse_dict_header(raw_headers.getvalue().decode("utf-8", errors="ignore"))
|
headers = HttpDirectory._parse_dict_header(raw_headers.getvalue().decode("utf-8", errors="ignore"))
|
||||||
raw_headers.close()
|
raw_headers.close()
|
||||||
curl.close()
|
|
||||||
|
|
||||||
path, name = os.path.split(stripped_url)
|
path, name = os.path.split(stripped_url)
|
||||||
date = headers.get("Last-Modified", "1970-01-01")
|
date = headers.get("Last-Modified", "1970-01-01")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user