Commit Graph

167 Commits

Author SHA1 Message Date
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
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
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
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
Cory Benfield e2a36dda0a Don't let proxy_bypass bring you down. 2014-01-07 09:37:59 +00:00
kennethreitz ba3dab5047 Merge pull request #1770 from kmadac/master
Implemetation of IP address ranges for no_proxy environment variable
2013-12-05 14:40:44 -08:00
Cory Benfield 57c138e59b Remove the unicode literals. 2013-12-05 21:06:11 +00:00
Kamil Madac 1d42d9d274 function is_ipv4_network renamed
more detailed check of cidr format
2013-12-05 11:15:52 +01:00
Kamil Madac f3bc8b6e1f Typo fixed 2013-12-05 09:36:49 +01:00
Kamil Madac 21c88c829a Broad exception fixed 2013-12-05 09:32:29 +01:00
kracekumar 6c1be607f1 Made default_user_agent reusable
This is not exciting change, but will help for people who wants to change name of user agent alone. Also name can be unicode.
2013-12-05 12:11:35 +05:30
Kamil Madac 59b29d02f8 Tiny comment fix 2013-12-04 15:11:10 +01:00
Kamil Madac 947248129b Better comments 2013-12-04 11:47:40 +01:00
Kamil Madac 8aff6f5ed0 Redesigned no_proxy ip range imlementation to use only stdlib functions 2013-12-03 16:23:08 +01:00
Kamil Madac 2c914126ba Added possibility to use IP ranges (ex. 192.168.1.0/24) to no_proxy environment variable 2013-12-02 22:32:29 +01:00
Cory Benfield e2961b9f91 Unquote the URL before extracting the auth. 2013-12-01 10:29:14 +00:00
Samuel Hug a501b0ca81 Fix for AppEngine 2013-10-28 09:51:56 -07:00