Commit Graph

1612 Commits

Author SHA1 Message Date
Avi Das c2e6fe4d5d Shorten str for case insensitive dict 2014-03-23 11:38:37 -05:00
Avi Das a3fb689942 Fix parenthesis typo 2014-03-22 16:30:22 -05:00
Avi Das 98ac3df713 Add __str__ to case insensitive dict. Logging headers for debugging purposes is often necessary, and the currently logging the headers would be using __repr__ which would log the implementation detail of headers, caseinsensitivedict. Adding str lends a more printing and log friendly implementation for case insentitice dict 2014-03-22 15:42:23 -05:00
kennethreitz 110048f983 Merge pull request #1916 from schlamar/accept-encoding
Fix Accept-Encoding in default headers
2014-03-12 16:37:27 -04:00
Cory Benfield ee7fe02953 Ensure that .raw() is present after unpickling.
Some people will assume that .raw() is present, and they shouldn't get
AttributeErrors when they make that assumption on a pickled Response.
However, @kennethreitz has asked that we not be too dependent on
urllib3. For that reason, set to None.
2014-03-12 18:34:43 +00:00
schlamar a59fac5e4b Removed compress from accepted encodings. 2014-03-12 12:11:55 +01:00
kennethreitz d8557a2627 Merge pull request #1935 from cjstapleton/master
Add timeout to stream with testing
2014-03-03 13:14:37 -05:00
kennethreitz 3c4b3747e4 Merge pull request #1921 from sigmavirus24/fix-session-header-none
Do not set headers with None value
2014-03-03 13:13:13 -05:00
cjstapleton 930f03c864 Add timeout to stream with testing
Fixes Issue #1803
2014-02-28 10:08:57 -06:00
Cory Benfield 81e88b70bd The timeout is in seconds. 2014-02-16 19:00:22 +00:00
Ian Cordasco d2f647cee4 Do not set headers with None value
- Regardless of whether they are on the session or not
- Fixes #1920
2014-02-14 16:15:21 -06:00
Zack Weinberg 0caa243212 New Response property, .is_redirect. 2014-02-13 14:27:42 -05:00
kennethreitz 4ecd74693f Merge pull request #1891 from sigmavirus24/add-requests-to-exceptions
Add request to RequestException
2014-02-11 11:58:23 -05:00
kennethreitz 1371e81944 Merge pull request #1900 from mjpieters/issue1674-json-fallback-encoding
Reinstate falling back to self.text for JSON responses
2014-02-11 11:55:20 -05:00
kennethreitz a44910b837 Merge pull request #1902 from mjpieters/master
Remove unused loggers.
2014-02-06 18:32:41 -08:00
Martijn Pieters 3443c177a3 Document the Response.reason attribute.
Made `.status_code` and `.reason` consistent with one another, adding some examples. Addresses #1225.
2014-02-05 17:29:09 +00:00
Martijn Pieters 488b90f5ac Remove unused loggers. 2014-02-03 13:43:59 +00:00
Martijn Pieters c5b6a107eb One last Charade reference to remove here. 2014-02-03 13:39:21 +00:00
Martijn Pieters f35838beb6 Remove logging and charade mention.
Logging is Not Allowed, so out it goes.
2014-02-03 13:37:57 +00:00
Martijn Pieters 5ee8b348eb Reinstate falling back to self.text for JSON responses
A JSON response that has no encoding specified will be decoded with a detected UTF codec (compliant with the JSON RFC), but if that fails, we guessed wrong and need to fall back to charade character detection (via `self.text`). Kenneth removed this functionality (by accident?) in 1451ba0c6d, this reinstates it again and adds a log warning.

Fixes #1674
2014-02-03 12:00:14 +00:00
Kenneth Reitz c6084704cc what is wrong with you people? :) 2014-01-31 12:31:11 -05:00
Kenneth Reitz 2b23d6a9f7 omg never do this again ever please 2014-01-31 12:30:52 -05:00
Kenneth Reitz c042c08179 who did this 2014-01-31 12:29:56 -05:00
Kenneth Reitz f74f5e3ebf cleanup shitty code 2014-01-31 12:27:05 -05:00
Cory Benfield d9f34c6848 Respect trust_env on redirect. 2014-01-31 07:36:44 +00:00
Cory Benfield 326a22e888 Better layout for checking. 2014-01-30 15:11:24 +00:00
Cory Benfield 7ba5a534ae Repopulate ~/.netrc auth. 2014-01-29 19:13:46 +00:00
Ian Cordasco 07e0a6198d Explicitly check for None 2014-01-28 20:39:09 -06:00
Ian Cordasco c2fab5b4ca Avoid having to fix tests 2014-01-28 20:24:41 -06:00
Ian Cordasco 27eb54a20a Move creation of attributes to RequestException
Pass request objects in HTTPAdapter
2014-01-28 20:13:57 -06:00
Konstantinos Koukopoulos 8b792be81b on redirect pass URL as bytes. Fixes: #1887 2014-01-28 09:11:23 -08:00
Kevin Burke 4c11fb7f04 s/soley/solely 2014-01-25 00:20:10 -08:00
Kenneth Reitz 33735480f7 v2.2.1 2014-01-23 13:25:40 -05:00
Donald Stufft d181577f3e Update urllib3 to 9346c5c 2014-01-22 14:20:34 -05:00
Cory Benfield 5b4e9aff0e Don't need to unquote twice. 2014-01-12 14:46:40 +00:00
Cory Benfield 2f98ef1792 Be less defensive in get_auth_from_url. 2014-01-12 14:44:53 +00:00
Cory Benfield b4ca6c95b6 Meet @sigmavirus24's demanding stylistic criteria. 2014-01-12 09:39:32 +00:00
Cory Benfield dddb41e349 TypeError, not AttributeError on 3.3. 2014-01-11 10:15:53 +00:00
Cory Benfield ca187abd13 Unquote the auth after splitting the url. 2014-01-11 09:59:23 +00:00
Kenneth Reitz 0db1d3d675 v2.2.0 2014-01-09 14:33:17 -05:00
Cory Benfield 4862d29a96 Make ContentDecodingError a subclass.
This should avoid the user having to worry about the new exception.
2014-01-09 19:08:58 +00:00
kennethreitz 14f207f3fc Merge pull request #1846 from acdha/paranoid-get_netrc_auth
get_netrc_auth should handle os.path.expanduser failing
2014-01-08 10:57:09 -08:00
Kenneth Reitz df1c2335c8 Merge branch 'master' into fix-pickling-adapters
Conflicts:
	AUTHORS.rst
2014-01-08 13:53:23 -05:00
kennethreitz b17cad65cf Merge pull request #1845 from Lukasa/proxy_bypass
Resolve proxy_bypass problems.
2014-01-08 10:51:08 -08:00
kennethreitz a855ba8189 Merge pull request #1827 from pepijndevos/master
Use adapter pool size for proxies
2014-01-08 10:50:00 -08:00
kennethreitz e93b07eef6 Merge pull request #1832 from kevinburke/docs-warnings
Fix warnings when building the docs
2014-01-08 10:45:33 -08:00
kennethreitz 73c3040896 Merge pull request #1836 from sigmavirus24/2014
Bump the year ftw
2014-01-08 10:44:20 -08:00
Kevin Burke e1562afb58 Update urllib3 to 232f496 2014-01-07 12:32:01 -08:00
Chris Adams a80bd7708d get_netrc_auth: code cleanup
* Stop iterating as soon as we find a netrc file
* More obvious return None
2014-01-07 12:23:11 -05:00
Chris Adams 0b41cec7a4 get_netrc_auth: handle os.path.expanduser failure
os.path.expanduser can raise a KeyError when $HOME is not set and the
POSIX getpwuid() call fails, which can happen when running under a UID
which is not in /etc/passwd or when the password file cannot be read.

The upstream bug report http://bugs.python.org/issue20164 is unlikely to
be backported to Python 2.x even if fixed so this change handles
KeyError by skipping netrc authentication.

Closes #1846
2014-01-07 11:34:51 -05:00