Compare commits

...

11 Commits

Author SHA1 Message Date
Kenneth Reitz
f549efd43d v1.0.2 2012-12-17 13:58:33 -05:00
Kenneth Reitz
5eb3a17b55 v1.0.2 2012-12-17 13:58:07 -05:00
Kenneth Reitz
b30b09e84c v1.0.1 2012-12-17 13:53:24 -05:00
Kenneth Reitz
5152c98223 fix for #1017 2012-12-17 13:52:46 -05:00
Kenneth Reitz
27c6dc3735 Merge pull request #1020 from Lukasa/misc
Fix off-by-one error.
2012-12-17 10:46:09 -08:00
Cory Benfield
8b1b706903 Fix off-by-one error. 2012-12-17 18:42:32 +00:00
Kenneth Reitz
64eee1eba7 v1.0.1 2012-12-17 13:42:03 -05:00
Kenneth Reitz
1e64fbcb55 CURL_CA_BUNDLE 2012-12-17 13:41:20 -05:00
Kenneth Reitz
910b2312d6 fix verify bug
Fixes #1019
2012-12-17 13:38:38 -05:00
Kenneth Reitz
9bb332fee1 remove .env 2012-12-17 12:55:40 -05:00
Kenneth Reitz
31c73a61f9 testimonial 2012-12-17 10:26:11 -05:00
6 changed files with 28 additions and 16 deletions

1
.env
View File

@@ -1 +0,0 @@
workon r

View File

@@ -3,6 +3,17 @@
History
-------
1.0.2 (2012-12-17)
++++++++++++++++++
- Proxy fix for HTTPAdapter.
1.0.1 (2012-12-17)
++++++++++++++++++
- Cert verification exception bug.
- Proxy fix for HTTPAdapter.
1.0.0 (2012-12-17)
++++++++++++++++++

View File

@@ -38,7 +38,7 @@ Requests takes all of the work out of Python HTTP/1.1 — making your integrati
Testimonials
------------
Amazon, Google, Twilio, Mozilla, Heroku, PayPal, Obama for America, Transifex, Native Instruments, The Washington Post, Twitter, SoundCloud, Kippt, Readability, and Federal US Institutions use Requests internally. It has been downloaded over 1,000,000 times from PyPI.
Amazon, Google, Twilio, Mozilla, Heroku, PayPal, NPR, Obama for America, Transifex, Native Instruments, The Washington Post, Twitter, SoundCloud, Kippt, Readability, and Federal US Institutions use Requests internally. It has been downloaded over 1,000,000 times from PyPI.
**Armin Ronacher**
Requests is the perfect example how beautiful an API can be with the

View File

@@ -42,8 +42,8 @@ is at <http://python-requests.org>.
"""
__title__ = 'requests'
__version__ = '1.0.0'
__build__ = 0x01000
__version__ = '1.0.2'
__build__ = 0x01002
__author__ = 'Kenneth Reitz'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2012 Kenneth Reitz'

View File

@@ -13,7 +13,7 @@ import socket
from .models import Response
from .auth import HTTPProxyAuth
from .packages.urllib3.poolmanager import PoolManager
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .hooks import dispatch_hook
from .compat import urlparse
from .utils import DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers
@@ -62,15 +62,7 @@ class HTTPAdapter(BaseAdapter):
# Allow self-specified cert location.
if verify is not True:
cert_loc = self.verify
# Look for configuration.
if not cert_loc and self.config.get('trust_env'):
cert_loc = os.environ.get('REQUESTS_CA_BUNDLE')
# Curl compatibility.
if not cert_loc and self.config.get('trust_env'):
cert_loc = os.environ.get('CURL_CA_BUNDLE')
cert_loc = verify
if not cert_loc:
cert_loc = DEFAULT_CA_BUNDLE_PATH
@@ -127,7 +119,7 @@ class HTTPAdapter(BaseAdapter):
proxy = proxies.get(urlparse(url).scheme)
if proxy:
conn = self.poolmanager.ProxyManager(self.poolmanager.proxy_from_url(proxy))
conn = proxy_from_url(proxy)
else:
conn = self.poolmanager.connection_from_url(url)

View File

@@ -8,6 +8,7 @@ This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from .compat import cookielib
from .cookies import cookiejar_from_dict
@@ -76,7 +77,7 @@ class SessionRedirectMixin(object):
resp.content # Consume socket so it can be released
if i > self.max_redirects:
if i >= self.max_redirects:
raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects)
# Release the connection back into the pool.
@@ -226,6 +227,15 @@ class Session(SessionRedirectMixin):
if not auth:
auth = get_netrc_auth(url)
# Look for configuration.
if not verify and verify is not False:
verify = os.environ.get('REQUESTS_CA_BUNDLE')
# Curl compatibility.
if not verify and verify is not False:
verify = os.environ.get('CURL_CA_BUNDLE')
# Merge all the kwargs.
params = merge_kwargs(params, self.params)
headers = merge_kwargs(headers, self.headers)