Commit Graph

187 Commits

Author SHA1 Message Date
Nate Prewitt d7f56ba938 reverting 3362 2016-08-09 07:36:39 -06:00
Ville Skyttä 542fbbc67f Document bunch of return types 2016-08-09 13:32:56 +03:00
kennethreitz fb01456061 Merge pull request #3429 from nateprewitt/docstring_cleanup
Docstring cleanup
2016-07-20 18:38:38 -04:00
Nate Prewitt b7809acb47 making class and function docstrings consistent 2016-07-20 11:43:47 -06:00
Nate Prewitt 2d4a89f5dc adding in pep8 fixes 2016-07-20 10:30:08 -06:00
Nate Prewitt 15a3869006 making module docstrings and coding comments consistent 2016-07-19 14:51:14 -06:00
Nate Prewitt be31a90906 Defining header value type requirements and tests 2016-07-05 17:32:05 -06:00
Nate Prewitt 71050e9ab9 adding in slice_length fix and test for chunk_size=None (#3370) 2016-07-02 15:56:20 -05:00
Nate Prewitt 2669ab797c check and test for headers containing return characters or leading whitespace 2016-07-02 13:10:47 -06:00
Nate Prewitt 92fe51c0af adding asserted_encoding check on None type encoding to match text() behavior (#3362) 2016-06-28 14:22:00 -05:00
Ian Cordasco cd4e6b9aef Merge pull request #3185 from brettdh/3183-support-all-proxy-env-var
Support ALL_PROXY environment variable
2016-05-17 10:42:31 -05:00
Kumar Varadarajulu 17b6c5742c consider plain ip notation of an ip in no_proxy if not in cidr notation 2016-05-16 06:11:25 +00:00
Brett Higgins 4bf8866172 Add 'all' proxy selection to select_proxy
It seems it's necessary both in pulling all_proxy from the environment
(rebuild_proxies) and deciding which proxy to use (select_proxy).

Also added new functional test.
2016-05-13 15:30:38 -04:00
John R. Lenton 4e7beef860 utils: let select_proxy not raise an exception when url has no hostname 2016-04-26 11:22:44 +01:00
Dmitry Dygalo 1eb153529a Merge remote-tracking branch 'upstream/master' into utils-unit-tests
Conflicts:
	tests/test_utils.py
2016-03-13 10:24:47 +01:00
Cory Benfield 6cc0b56d51 Switch to treat files without tell() as zero-length 2016-03-07 09:05:43 +00:00
Cory Benfield e034dd1140 Allow for exceptions from tell() 2016-03-07 08:31:23 +00:00
Dmitry Dygalo f123f89d32 Added unit tests for utils module 2016-02-19 10:32:23 +01:00
Cory Benfield 6e0649d9f8 Push code review advice from @sigmavirus24 2015-12-19 08:44:21 +00:00
Cory Benfield 589f13ca9d Handle bytes and unicode URLs for netloc 2015-12-18 09:22:23 +00:00
Ian Cordasco 5397ef71b3 Fix super_len for partially read files
Closes #2872
2015-11-10 21:22:24 -06:00
Cory Benfield f1fd11e54f Emit warnings when using text mode files. 2015-10-24 09:29:23 +01:00
Ian Cordasco 96e9490100 Merge pull request #2803 from asieira/master
Update default user-agent (#2785)
2015-10-05 09:54:17 -05:00
Cory Benfield d996a95cf7 Merge pull request #2721 from Lukasa/no_proxy_fix
Ignore empty fields in no_proxy env var
2015-10-05 15:28:49 +01:00
Alexandre Sieira 2a635ba87d Update default user-agent (#2785)
* Updated default user agent so that it includes only the requests
version;
* Added PyCharm / IDEA project directory to `.gitignore`.
2015-10-05 11:18:23 -03:00
Jason Grout 4c6540898c don't lowercase a url before urlparsing it
urlparse automatically lowercases the scheme and hostname
2015-08-28 20:20:07 +00:00
Jason Grout c80121df91 Fix documentation for the proxies dictionary 2015-08-27 18:21:04 +00:00
Jason Grout 500f15da1f Factor out the proxy selection code 2015-08-27 18:21:04 +00:00
Cory Benfield b6127ca9ca Ignore empty fields in no_proxy 2015-08-13 15:04:49 -04:00
David Pursehouse 884cb7a7fb Change ignore_errors to raise_errors in get_netrc_auth
Change-Id: Ib82c7c614edafc15e5db858d9c1b9a73aebd8a95
2015-06-29 12:22:57 +09:00
David Pursehouse a560e09427 Allow get_netrc_auth to raise parse/permission errors to caller
If the netrc file exists but cannot be parsed or read, get_netrc_auth
silently fails.

Add a new argument `ignore_errors` which when set to False will cause
any parse/permission errors to be raised to the caller.  The default
value is True, which means the default behavior is unchanged.

Fixes #2654

Change-Id: I7436aaaf593178673ab84fd9e7ab4bcb0e3fe75e
2015-06-29 10:56:51 +09:00
kennethreitz b137472936 Merge pull request #2393 from sigmavirus24/bug/2356
Attempt to quote anyway if unquoting fails
2015-01-27 10:24:34 -08:00
Ian Cordasco eec44dbbb1 Check that a filename is a basestring instance
Instead of only checking one or another type of string-like object that
we accept, let's be able to check both. Previously, we only checked if
the filename was an instance of the native str type which on Python 2
excluded unicode filenames and bytes-like filenames on Python 3.

Fixes #2411
2015-01-20 20:44:52 -06:00
Ian Cordasco 751b35c346 Attempt to quote anyway if unquoting fails
Fixes #2356
2015-01-18 21:07:43 -06:00
Arthur Darcet e8d02ea0bb utils.guess_filename fails if the given parameter looks like a file object but has a non-string name attribute
e.g. a cherrypy uploaded file behave like a regular file, except that its name attribute is an int and passing it directly to requests fails because of that
2014-12-12 17:32:43 +01:00
Ian Cordasco d505b94fa4 Add DeprecationWarnings to inform users of plans
After a long discussion in IRC and on several issues, the developers of
requests have decided to remove specific functions from requests.utils
in version 3.0.0. To give users ample time to prepare for this, we've
added DeprecationWarnings long in advance. See also the planning of this
in issue #2266.
2014-10-26 19:24:41 -05:00
Michael DeLay 8339b60fd5 Made more better 2014-10-10 09:58:30 -07:00
mikecool1000 ce1ac88543 Fixed #2250 2014-10-09 12:22:18 -07:00
mikecool1000 4594667f07 Update utils.py
Fixed -2250
2014-10-08 19:26:07 -07:00
kennethreitz 5850b1f53b Merge pull request #2249 from t-8ch/fix_2247
fix #2247
2014-10-05 13:19:14 -04:00
Kenneth Reitz 79f56e2e7e fix documentation for utils.get_unicode_from_response() :) 2014-10-05 13:14:38 -04:00
Thomas Weißschuh 6e1db21733 fix #2247
We have to pass urllib3 the url without the authentication information,
else it will be parsed by httplib as a netloc and included in the request line
and Host header
2014-09-25 19:49:28 +00:00
Kevin Burke 59f5a1089a add trailing comma 2014-08-29 12:06:58 -07:00
Kenneth Reitz d33ce49aaa keep-alive 2014-08-28 13:05:30 -04:00
kennethreitz c023f06aad Merge pull request #1924 from schlamar/proxy-default-scheme
Default proxy scheme to HTTP
2014-05-12 15:05:56 -04:00
Pavlo Kapyshin 4ca4865170 Fix typo 2014-04-10 06:09:41 +03:00
kennethreitz fe4c4f1461 Merge pull request #1951 from Lukasa/proxyauth
Re-evaluate proxy authorization.
2014-03-23 10:51:48 -04:00
Cory Benfield 6d7e8a97bb Split get_environ_proxies into two methods.
This makes it possible to get at the no_proxy logic separately.
2014-03-12 19:20:12 +00:00
schlamar a59fac5e4b Removed compress from accepted encodings. 2014-03-12 12:11:55 +01:00
schlamar 780ce3902e Revert "Proxy urls should have explicit schemes."
This reverts commit 840540b6b1.

Conflicts:
	requests/adapters.py
	requests/utils.py
2014-02-18 15:15:36 +01:00