Skip to content
This repository has been archived by the owner on Mar 31, 2018. It is now read-only.

requests support >= 0.9 #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crate/pypi/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def download(self):
"If-Modified-Since": stored_file_data["modified"],
}

resp = requests.get(file_data["file"], headers=headers, prefetch=True)
resp = requests.get(file_data["file"], headers=headers, stream=False)

if resp.status_code == 304:
logger.info("[DOWNLOAD] skipping %(filename)s because it has not been modified" % {"filename": release_file.filename})
Expand Down Expand Up @@ -482,13 +482,13 @@ def verify_and_sync_pages(self):
if self.datastore.get(SERVERKEY_KEY):
key = load_key(self.datastore.get(SERVERKEY_KEY))
else:
serverkey = requests.get(SERVERKEY_URL, prefetch=True)
serverkey = requests.get(SERVERKEY_URL, stream=False)
key = load_key(serverkey.content)
self.datastore.set(SERVERKEY_KEY, serverkey.content)

try:
# Download the "simple" page from PyPI for this package
simple = requests.get(urlparse.urljoin(SIMPLE_URL, urllib.quote(self.name.encode("utf-8"))), prefetch=True)
simple = requests.get(urlparse.urljoin(SIMPLE_URL, urllib.quote(self.name.encode("utf-8"))), stream=False)
simple.raise_for_status()
except requests.HTTPError:
if simple.status_code == 404:
Expand All @@ -500,7 +500,7 @@ def verify_and_sync_pages(self):

try:
# Download the "serversig" page from PyPI for this package
serversig = requests.get(urlparse.urljoin(SERVERSIG_URL, urllib.quote(self.name.encode("utf-8"))), prefetch=True)
serversig = requests.get(urlparse.urljoin(SERVERSIG_URL, urllib.quote(self.name.encode("utf-8"))), stream=False)
serversig.raise_for_status()
except requests.HTTPError:
if serversig.status_code == 404:
Expand Down
4 changes: 2 additions & 2 deletions crate/pypi/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def process(name, version, timestamp, action, matches):

def remove(name, version, timestamp, action, matches):
package = PyPIPackage(name, version)
package.delete()
eackage.delete()


def remove_file(name, version, timestamp, action, matches):
Expand Down Expand Up @@ -203,7 +203,7 @@ def fetch_server_key(package):

@task
def refresh_pypi_package_index_cache():
r = requests.get("http://pypi.python.org/simple/", prefetch=True)
r = requests.get("http://pypi.python.org/simple/", stream=False)
PyPIIndexPage.objects.create(content=r.content)


Expand Down