diff --git a/.env b/.env deleted file mode 100644 index 04f2d7fb44..0000000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -workon r diff --git a/.gitignore b/.gitignore index e5c382512a..9fcc6c3dda 100644 --- a/.gitignore +++ b/.gitignore @@ -5,12 +5,20 @@ nosetests.xml junit-report.xml pylint.txt toy.py +tox.ini violations.pyflakes.txt cover/ +build/ docs/_build requests.egg-info/ *.pyc *.swp +*.egg env/ .workon + +t.py + +t2.py +dist diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 219862477a..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: python -python: - - 2.6 - - 2.7 - - 3.2 -env: HTTPBIN_URL=http://httpbin.org/ -script: make travis -install: - - pip install nose - - pip install . --use-mirrors diff --git a/AUTHORS.rst b/AUTHORS.rst index 1d66c4bf70..71171d0821 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -4,7 +4,14 @@ various contributors: Development Lead ```````````````` -- Kenneth Reitz +- Kenneth Reitz `@kennethreitz `_ + +Core Contributors +````````````````` + +- Cory Benfield `@lukasa `_ +- Ian Cordasco `@sigmavirus24 `_ + Urllib3 @@ -39,7 +46,7 @@ Patches and Suggestions - Peter Manser - Jeremy Selier - Jens Diemer -- Alex <@alopatin> +- Alex (`@alopatin `_) - Tom Hogans - Armin Ronacher - Shrikant Sharat Kandula @@ -76,11 +83,10 @@ Patches and Suggestions - Chase Sterling - Marty Alchin - takluyver -- Ben Toews (mastahyeti) +- Ben Toews (`@mastahyeti `_) - David Kemp - Brendon Crawford -- Denis (Telofy) -- Cory Benfield (Lukasa) +- Denis (`@Telofy `_) - Matt Giuca - Adam Tauber - Honza Javorek @@ -97,20 +103,58 @@ Patches and Suggestions - Jonty Wareing - Shivaram Lingamneni - Miguel Turner -- Rohan Jain (crodjer) +- Rohan Jain (`@crodjer `_) - Justin Barber -- Roman Haritonov <@reclosedev> +- Roman Haritonov (`@reclosedev `_) - Josh Imhoff - Arup Malakar -- Danilo Bargen (gwrtheyrn) +- Danilo Bargen (`@dbrgn `_) - Torsten Landschoff -- Michael Holler (apotheos) +- Michael Holler (`@apotheos `_) - Timnit Gebru - Sarah Gonzalez - Victoria Mo - Leila Muhtasib - Matthias Rahlf - Jakub Roztocil -- Ian Cordasco @sigmavirus24 - Rhys Elsmore -- André Graf (dergraf) +- André Graf (`@dergraf `_) +- Stephen Zhuang (`@everbird `_) +- Martijn Pieters +- Jonatan Heyman +- David Bonner (`@rascalking `_) +- Vinod Chandru +- Johnny Goodnow +- Denis Ryzhkov +- Wilfred Hughes +- Dmitry Medvinsky +- Bryce Boe (`@bboe `_) +- Colin Dunklau (`@cdunklau `_) +- Bob Carroll (`@rcarz `_) +- Hugo Osvaldo Barrera (`@hobarrera `_) +- Łukasz Langa +- Dave Shawley +- James Clarke (`@jam `_) +- Kevin Burke +- Flavio Curella +- David Pursehouse (`@dpursehouse `_) +- Jon Parise +- Alexander Karpinsky (`@homm86 `_) +- Marc Schlaich (`@schlamar `_) +- Park Ilsu (`@daftshady `_) +- Matt Spitz (`@mattspitz `_) +- Vikram Oberoi (`@voberoi `_) +- Can Ibanoglu (`@canibanoglu `_) +- Thomas Weißschuh (`@t-8ch `_) +- Jayson Vantuyl +- Pengfei.X +- Kamil Madac +- Michael Becker (`@beckerfuffle `_) +- Erik Wickstrom (`@erikwickstrom `_) +- Константин Подшумок (`@podshumok `_) +- Ben Bass (`@codedstructure `_) +- Jonathan Wong (`@ContinuousFunction `_) +- Martin Jul (`@mjul `_) +- Joe Alcorn (`@buttscicles `_) +- Syed Suhail Ahmed (`@syedsuhail `_) +- Scott Sadler (`@ssadler `_) diff --git a/HISTORY.rst b/HISTORY.rst index 1416c46339..0d0d216d55 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,7 +1,315 @@ .. :changelog: -History -------- +Release History +--------------- + +2.4.3 (2014-10-06) +++++++++++++++++++ + +**Bugfixes** + +- Unicode URL improvements for Python 2. +- Re-order JSON param for backwards compat. +- Automatically defrag authentication schemes from host/pass URIs. (`#2249 `_) + + +2.4.2 (2014-10-05) +++++++++++++++++++ + +**Improvements** + +- FINALLY! Add json parameter for uploads! (`#2258 `_) +- Support for bytestring URLs on Python 3.x (`#2238 `_) + +**Bugfixes** + +- Avoid getting stuck in a loop (`#2244 `_) +- Multiple calls to iter* fail with unhelpful error. (`#2240 `_, `#2241 `_) + +**Documentation** + +- Correct redirection introduction (`#2245 `_) +- Added example of how to send multiple files in one request. (`#2227 `_) +- Clarify how to pass a custom set of CAs (`#2248 `_) + + + +2.4.1 (2014-09-09) +++++++++++++++++++ + +- Now has a "security" package extras set, ``$ pip install requests[security]`` +- Requests will now use Certifi if it is available. +- Capture and re-raise urllib3 ProtocolError +- Bugfix for responses that attempt to redirect to themselves forever (wtf?). + + +2.4.0 (2014-08-29) +++++++++++++++++++ + +**Behavioral Changes** + +- ``Connection: keep-alive`` header is now sent automatically. + +**Improvements** + +- Support for connect timeouts! Timeout now accepts a tuple (connect, read) which is used to set individual connect and read timeouts. +- Allow copying of PreparedRequests without headers/cookies. +- Updated bundled urllib3 version. +- Refactored settings loading from environment — new `Session.merge_environment_settings`. +- Handle socket errors in iter_content. + + +2.3.0 (2014-05-16) +++++++++++++++++++ + +**API Changes** + +- New ``Response`` property ``is_redirect``, which is true when the + library could have processed this response as a redirection (whether + or not it actually did). +- The ``timeout`` parameter now affects requests with both ``stream=True`` and + ``stream=False`` equally. +- The change in v2.0.0 to mandate explicit proxy schemes has been reverted. + Proxy schemes now default to ``http://``. +- The ``CaseInsensitiveDict`` used for HTTP headers now behaves like a normal + dictionary when references as string or viewed in the interpreter. + +**Bugfixes** + +- No longer expose Authorization or Proxy-Authorization headers on redirect. + Fix CVE-2014-1829 and CVE-2014-1830 respectively. +- Authorization is re-evaluated each redirect. +- On redirect, pass url as native strings. +- Fall-back to autodetected encoding for JSON when Unicode detection fails. +- Headers set to ``None`` on the ``Session`` are now correctly not sent. +- Correctly honor ``decode_unicode`` even if it wasn't used earlier in the same + response. +- Stop advertising ``compress`` as a supported Content-Encoding. +- The ``Response.history`` parameter is now always a list. +- Many, many ``urllib3`` bugfixes. + +2.2.1 (2014-01-23) +++++++++++++++++++ + +**Bugfixes** + +- Fixes incorrect parsing of proxy credentials that contain a literal or encoded '#' character. +- Assorted urllib3 fixes. + +2.2.0 (2014-01-09) +++++++++++++++++++ + +**API Changes** + +- New exception: ``ContentDecodingError``. Raised instead of ``urllib3`` + ``DecodeError`` exceptions. + +**Bugfixes** + +- Avoid many many exceptions from the buggy implementation of ``proxy_bypass`` on OS X in Python 2.6. +- Avoid crashing when attempting to get authentication credentials from ~/.netrc when running as a user without a home directory. +- Use the correct pool size for pools of connections to proxies. +- Fix iteration of ``CookieJar`` objects. +- Ensure that cookies are persisted over redirect. +- Switch back to using chardet, since it has merged with charade. + +2.1.0 (2013-12-05) +++++++++++++++++++ + +- Updated CA Bundle, of course. +- Cookies set on individual Requests through a ``Session`` (e.g. via ``Session.get()``) are no longer persisted to the ``Session``. +- Clean up connections when we hit problems during chunked upload, rather than leaking them. +- Return connections to the pool when a chunked upload is successful, rather than leaking it. +- Match the HTTPbis recommendation for HTTP 301 redirects. +- Prevent hanging when using streaming uploads and Digest Auth when a 401 is received. +- Values of headers set by Requests are now always the native string type. +- Fix previously broken SNI support. +- Fix accessing HTTP proxies using proxy authentication. +- Unencode HTTP Basic usernames and passwords extracted from URLs. +- Support for IP address ranges for no_proxy environment variable +- Parse headers correctly when users override the default ``Host:`` header. +- Avoid munging the URL in case of case-sensitive servers. +- Looser URL handling for non-HTTP/HTTPS urls. +- Accept unicode methods in Python 2.6 and 2.7. +- More resilient cookie handling. +- Make ``Response`` objects pickleable. +- Actually added MD5-sess to Digest Auth instead of pretending to like last time. +- Updated internal urllib3. +- Fixed @Lukasa's lack of taste. + +2.0.1 (2013-10-24) +++++++++++++++++++ + +- Updated included CA Bundle with new mistrusts and automated process for the future +- Added MD5-sess to Digest Auth +- Accept per-file headers in multipart file POST messages. +- Fixed: Don't send the full URL on CONNECT messages. +- Fixed: Correctly lowercase a redirect scheme. +- Fixed: Cookies not persisted when set via functional API. +- Fixed: Translate urllib3 ProxyError into a requests ProxyError derived from ConnectionError. +- Updated internal urllib3 and chardet. + +2.0.0 (2013-09-24) +++++++++++++++++++ + +**API Changes:** + +- Keys in the Headers dictionary are now native strings on all Python versions, + i.e. bytestrings on Python 2, unicode on Python 3. +- Proxy URLs now *must* have an explicit scheme. A ``MissingSchema`` exception + will be raised if they don't. +- Timeouts now apply to read time if ``Stream=False``. +- ``RequestException`` is now a subclass of ``IOError``, not ``RuntimeError``. +- Added new method to ``PreparedRequest`` objects: ``PreparedRequest.copy()``. +- Added new method to ``Session`` objects: ``Session.update_request()``. This + method updates a ``Request`` object with the data (e.g. cookies) stored on + the ``Session``. +- Added new method to ``Session`` objects: ``Session.prepare_request()``. This + method updates and prepares a ``Request`` object, and returns the + corresponding ``PreparedRequest`` object. +- Added new method to ``HTTPAdapter`` objects: ``HTTPAdapter.proxy_headers()``. + This should not be called directly, but improves the subclass interface. +- ``httplib.IncompleteRead`` exceptions caused by incorrect chunked encoding + will now raise a Requests ``ChunkedEncodingError`` instead. +- Invalid percent-escape sequences now cause a Requests ``InvalidURL`` + exception to be raised. +- HTTP 208 no longer uses reason phrase ``"im_used"``. Correctly uses + ``"already_reported"``. +- HTTP 226 reason added (``"im_used"``). + +**Bugfixes:** + +- Vastly improved proxy support, including the CONNECT verb. Special thanks to + the many contributors who worked towards this improvement. +- Cookies are now properly managed when 401 authentication responses are + received. +- Chunked encoding fixes. +- Support for mixed case schemes. +- Better handling of streaming downloads. +- Retrieve environment proxies from more locations. +- Minor cookies fixes. +- Improved redirect behaviour. +- Improved streaming behaviour, particularly for compressed data. +- Miscellaneous small Python 3 text encoding bugs. +- ``.netrc`` no longer overrides explicit auth. +- Cookies set by hooks are now correctly persisted on Sessions. +- Fix problem with cookies that specify port numbers in their host field. +- ``BytesIO`` can be used to perform streaming uploads. +- More generous parsing of the ``no_proxy`` environment variable. +- Non-string objects can be passed in data values alongside files. + +1.2.3 (2013-05-25) +++++++++++++++++++ + +- Simple packaging fix + + +1.2.2 (2013-05-23) +++++++++++++++++++ + +- Simple packaging fix + + +1.2.1 (2013-05-20) +++++++++++++++++++ + +- 301 and 302 redirects now change the verb to GET for all verbs, not just + POST, improving browser compatibility. +- Python 3.3.2 compatibility +- Always percent-encode location headers +- Fix connection adapter matching to be most-specific first +- new argument to the default connection adapter for passing a block argument +- prevent a KeyError when there's no link headers + +1.2.0 (2013-03-31) +++++++++++++++++++ + +- Fixed cookies on sessions and on requests +- Significantly change how hooks are dispatched - hooks now receive all the + arguments specified by the user when making a request so hooks can make a + secondary request with the same parameters. This is especially necessary for + authentication handler authors +- certifi support was removed +- Fixed bug where using OAuth 1 with body ``signature_type`` sent no data +- Major proxy work thanks to @Lukasa including parsing of proxy authentication + from the proxy url +- Fix DigestAuth handling too many 401s +- Update vendored urllib3 to include SSL bug fixes +- Allow keyword arguments to be passed to ``json.loads()`` via the + ``Response.json()`` method +- Don't send ``Content-Length`` header by default on ``GET`` or ``HEAD`` + requests +- Add ``elapsed`` attribute to ``Response`` objects to time how long a request + took. +- Fix ``RequestsCookieJar`` +- Sessions and Adapters are now picklable, i.e., can be used with the + multiprocessing library +- Update charade to version 1.0.3 + +The change in how hooks are dispatched will likely cause a great deal of +issues. + +1.1.0 (2013-01-10) +++++++++++++++++++ + +- CHUNKED REQUESTS +- Support for iterable response bodies +- Assume servers persist redirect params +- Allow explicit content types to be specified for file data +- Make merge_kwargs case-insensitive when looking up keys + +1.0.3 (2012-12-18) +++++++++++++++++++ + +- Fix file upload encoding bug +- Fix cookie behavior + +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) +++++++++++++++++++ + +- Massive Refactor and Simplification +- Switch to Apache 2.0 license +- Swappable Connection Adapters +- Mountable Connection Adapters +- Mutable ProcessedRequest chain +- /s/prefetch/stream +- Removal of all configuration +- Standard library logging +- Make Response.json() callable, not property. +- Usage of new charade project, which provides python 2 and 3 simultaneous chardet. +- Removal of all hooks except 'response' +- Removal of all authentication helpers (OAuth, Kerberos) + +This is not a backwards compatible change. + +0.14.2 (2012-10-27) ++++++++++++++++++++ + +- Improved mime-compatible JSON handling +- Proxy fixes +- Path hack fixes +- Case-Insensistive Content-Encoding headers +- Support for CJK parameters in form posts + + +0.14.1 (2012-10-01) ++++++++++++++++++++ + +- Python 3.3 Compatibility +- Simply default accept-encoding +- Bugfixes + 0.14.0 (2012-09-02) ++++++++++++++++++++ @@ -513,10 +821,10 @@ History ++++++++++++++++++ * New HTTPHandling Methods - - Reponse.__nonzero__ (false if bad HTTP Status) + - Response.__nonzero__ (false if bad HTTP Status) - Response.ok (True if expected HTTP Status) - Response.error (Logged HTTPError if bad HTTP Status) - - Reponse.raise_for_status() (Raises stored HTTPError) + - Response.raise_for_status() (Raises stored HTTPError) 0.2.2 (2011-02-14) diff --git a/LICENSE b/LICENSE index e79211cd46..8c5e758401 100644 --- a/LICENSE +++ b/LICENSE @@ -1,13 +1,13 @@ -Copyright (c) 2012 Kenneth Reitz. +Copyright 2014 Kenneth Reitz -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/MANIFEST.in b/MANIFEST.in index 75b3f3d615..439de496f0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include README.rst LICENSE NOTICE HISTORY.rst tests/*. requests/cacert.pem +include README.rst LICENSE NOTICE HISTORY.rst test_requests.py requirements.txt requests/cacert.pem diff --git a/Makefile b/Makefile index 1473d1258b..dea33a3f2c 100644 --- a/Makefile +++ b/Makefile @@ -1,80 +1,39 @@ -SHELL := /bin/bash - -# these files should pass pyflakes -# exclude ./env/, which may contain virtualenv packages -PYFLAKES_WHITELIST=$(shell find . -name "*.py" ! -path "./docs/*" ! -path "./tests/*" \ - ! -path "./requests/packages/*" ! -path "./env/*" \ - ! -path "./requests/__init__.py" ! -path "./requests/compat.py") - -# hack: if pyflakes is available, set this to the location of pyflakes -# if it's not, e.g., in the Python 3 or PyPy Jenkins environments, set it to -# the location of the no-op `true` command. -PYFLAKES_IF_AVAILABLE=$(shell if which pyflakes > /dev/null ; \ - then which pyflakes; \ - else which true; fi ) - -# test_requests_ext.py depends on external services, and async doesn't work under Python 3 -# Travis/Jenkins should be ensuring that all other tests pass on all supported versions -CI_TESTS=$(shell find tests/ -name "*.py" ! -name "test_requests_ext.py" ! -name "test_requests_async.py") +.PHONY: docs init: - python setup.py develop pip install -r requirements.txt test: - nosetests ./tests/* - -lazy: - nosetests --with-color tests/test_requests.py - -simple: - nosetests tests/test_requests.py - -pyflakes: - pyflakes ${PYFLAKES_WHITELIST} - -cipyflakes: - ${PYFLAKES_IF_AVAILABLE} ${PYFLAKES_WHITELIST} + # This runs all of the tests. To run an individual test, run py.test with + # the -k flag, like "py.test -k test_path_is_not_double_encoded" + py.test test_requests.py -citests: - nosetests ${CI_TESTS} --with-xunit --xunit-file=junit-report.xml +coverage: + py.test --verbose --cov-report term --cov=requests test_requests.py -ci: citests cipyflakes +ci: init + py.test --junitxml=junit.xml -travis: citests - -server: - gunicorn httpbin:app --bind=0.0.0.0:7077 & - -# compute statistics of various kinds -lemonade: - -pyflakes requests > violations.pyflakes.txt - # HTML output will be available in the default location, ./cover/ - nosetests --with-coverage --cover-html --cover-package=requests ${CI_TESTS} ./tests/test_requests_async.py +certs: + curl http://ci.kennethreitz.org/job/ca-bundle/lastSuccessfulBuild/artifact/cacerts.pem -o requests/cacert.pem -site: - cd docs; make dirhtml +deps: urllib3 chardet -clean: - git clean -Xfd +urllib3: + git clone https://github.com/shazow/urllib3.git && rm -fr requests/packages/urllib3 && mv urllib3/urllib3 requests/packages/ && rm -fr urllib3 -deps: urllib3 certs +chardet: + git clone https://github.com/chardet/chardet.git && rm -fr requests/packages/chardet && mv chardet/chardet requests/packages/ && rm -fr chardet -urllib3: - rm -fr requests/packages/urllib3 - git clone https://github.com/shazow/urllib3.git - cd urllib3 && git checkout master && cd .. - mv urllib3/urllib3 requests/packages/ - rm -fr urllib3 +publish: + python setup.py register + python setup.py sdist upload + python setup.py bdist_wheel upload -oauthlib: - rm -fr requests/packages/oauthlib - git clone https://github.com/idan/oauthlib.git - cd oauthlib && git checkout master && cd .. - mv oauthlib/oauthlib requests/packages/ - rm -fr oauthlib -certs: - cd requests && curl -O https://raw.github.com/kennethreitz/certifi/master/certifi/cacert.pem +docs-init: + pip install -r docs/requirements.txt -docs: site +docs: + cd docs && make html + @echo "\033[95m\n\nBuild successful! View the docs homepage at docs/_build/html/index.html.\n\033[0m" diff --git a/NOTICE b/NOTICE index 375bd9d983..f583e47ab2 100644 --- a/NOTICE +++ b/NOTICE @@ -6,24 +6,26 @@ Urllib3 License This is the MIT license: http://www.opensource.org/licenses/mit-license.php Copyright 2008-2011 Andrey Petrov and contributors (see CONTRIBUTORS.txt), -Modifications copyright 2022 Kenneth Reitz. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this -software and associated documentation files (the "Software"), to deal in the Software -without restriction, including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - +Modifications copyright 2012 Kenneth Reitz. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Chardet License =============== @@ -44,73 +46,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +CA Bundle License +================= -Chardet2 License -================ - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -02110-1301 USA - - - -Bundle of CA Root Certificates -============================== - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -02110-1301 - - -OAuthlib -======== - -Copyright (c) 2011 Idan Gazit and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of this project nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/README.rst b/README.rst index 2a9208cc50..521ab6f209 100644 --- a/README.rst +++ b/README.rst @@ -1,11 +1,14 @@ Requests: HTTP for Humans ========================= +.. image:: https://badge.fury.io/py/requests.png + :target: http://badge.fury.io/py/requests -.. image:: https://secure.travis-ci.org/kennethreitz/requests.png?branch=develop - :target: https://secure.travis-ci.org/kennethreitz/requests +.. image:: https://pypip.in/d/requests/badge.png + :target: https://crate.io/packages/requests/ -Requests is an ISC Licensed HTTP library, written in Python, for human + +Requests is an Apache2 Licensed HTTP library, written in Python, for human beings. Most existing Python modules for sending HTTP requests are extremely @@ -16,7 +19,7 @@ perform the simplest of tasks. Things shouldn't be this way. Not in Python. -:: +.. code-block:: pycon >>> r = requests.get('https://api.github.com', auth=('user', 'pass')) >>> r.status_code @@ -49,30 +52,34 @@ Features - Multipart File Uploads - Connection Timeouts - Thread-safety +- HTTP(S) proxy support Installation ------------ -To install requests, simply: :: +To install Requests, simply: - $ pip install requests +.. code-block:: bash -Or, if you absolutely must: :: + $ pip install requests - $ easy_install requests -But, you really shouldn't do that. +Documentation +------------- +Documentation is available at http://docs.python-requests.org/. Contribute ---------- -#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet. -#. Fork `the repository`_ on Github to start making your changes to the **develop** branch (or branch off of it). +#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a `Contributor Friendly`_ tag for issues that should be ideal for people who are not very familiar with the codebase yet. +#. If you feel uncomfortable or uncertain about an issue or your changes, feel free to email @sigmavirus24 and he will happily help you via email, Skype, remote pairing or whatever you are comfortable with. +#. Fork `the repository`_ on GitHub to start making your changes to the **master** branch (or branch off of it). #. Write a test which shows that the bug was fixed or that the feature works as expected. #. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_. .. _`the repository`: http://github.com/kennethreitz/requests -.. _AUTHORS: https://github.com/kennethreitz/requests/blob/develop/AUTHORS.rst +.. _AUTHORS: https://github.com/kennethreitz/requests/blob/master/AUTHORS.rst +.. _Contributor Friendly: https://github.com/kennethreitz/requests/issues?direction=desc&labels=Contributor+Friendly&page=1&sort=updated&state=open diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 4d34122303..e60cf4518e 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -1,6 +1,6 @@ @@ -11,32 +11,43 @@

Requests is an elegant and simple HTTP library for Python, built for - human beings. You are currently looking at the documentation of the - development release. + human beings.

Donate

-

- If you love Requests, consider supporting the author on Gittip: -

-

- -

-

Feedback

-

- Feedback is greatly appreciated. If you have any questions, comments, - random praise, or anonymous threats, - shoot me an email. -

+

+ If you love Requests, consider supporting the author on Gratipay: +

+

+ +

+ + +

Get Updates

+

Receive updates on new releases and upcoming projects.

+

Subscribe to Newsletter

+ + +

Translations

+

Useful Links

diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 6a75a67d23..930fdb3d41 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -1,6 +1,6 @@

@@ -14,12 +14,20 @@ development release.

+

Donate

-

- If you love Requests, consider supporting the author on Gittip: -

-

- -

\ No newline at end of file +

+ If you love Requests, consider supporting the author on Gittip: +

+

+ +

+ +

Get Updates

+

Receive updates on new releases and upcoming projects.

+ +

Subscribe to Newsletter

+ + diff --git a/docs/_themes/README.rst b/docs/_themes/README.rst index de8310a27e..dd8d7c078a 100644 --- a/docs/_themes/README.rst +++ b/docs/_themes/README.rst @@ -11,15 +11,15 @@ this guide: 2. add this to your conf.py: :: - sys.path.append(os.path.abspath('_themes')) - html_theme_path = ['_themes'] - html_theme = 'flask' + sys.path.append(os.path.abspath('_themes')) + html_theme_path = ['_themes'] + html_theme = 'flask' The following themes exist: **kr** - the standard flask documentation theme for large projects + the standard flask documentation theme for large projects **kr_small** - small one-page theme. Intended to be used by very small addon libraries. + small one-page theme. Intended to be used by very small addon libraries. diff --git a/docs/_themes/kr/layout.html b/docs/_themes/kr/layout.html index 56ee393ea4..cf977d8fea 100644 --- a/docs/_themes/kr/layout.html +++ b/docs/_themes/kr/layout.html @@ -5,6 +5,7 @@ {% endif %} + {% endblock %} {%- block relbar2 %}{% endblock %} {%- block footer %} @@ -24,6 +25,12 @@ t.parentNode.insertBefore(s, t); })(); /* ]]> */ + +