In docs, use intersphinx to link to Python documentation

The intersphinx extension can generate automatic links to the
documentation of objects in other projects. It was already used for
urllib3. For complete details on intersphinx, see:

http://www.sphinx-doc.org/en/master/ext/intersphinx.html
This commit is contained in:
Jon Dufresne
2018-06-10 10:47:22 -07:00
parent 922aa406b5
commit 5aa6a9b654
3 changed files with 19 additions and 22 deletions
+4 -1
View File
@@ -376,4 +376,7 @@ epub_exclude_files = ['search.html']
# If false, no index is generated.
#epub_use_index = True
intersphinx_mapping = {'urllib3': ('https://urllib3.readthedocs.io/en/latest', None)}
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'urllib3': ('https://urllib3.readthedocs.io/en/latest', None),
}
+10 -14
View File
@@ -351,13 +351,11 @@ file-like object for your body::
with open('massive-body', 'rb') as f:
requests.post('http://some.url/streamed', data=f)
.. warning:: It is strongly recommended that you open files in `binary mode`_.
This is because Requests may attempt to provide the
``Content-Length`` header for you, and if it does this value will
be set to the number of *bytes* in the file. Errors may occur if
you open the file in *text mode*.
.. _binary mode: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files
.. warning:: It is strongly recommended that you open files in :ref:`binary
mode <tut-files>`. This is because Requests may attempt to provide
the ``Content-Length`` header for you, and if it does this value
will be set to the number of *bytes* in the file. Errors may occur
if you open the file in *text mode*.
.. _chunk-encoding:
@@ -408,13 +406,11 @@ To do that, just set files to a list of tuples of ``(form_field_name, file_info)
...
}
.. warning:: It is strongly recommended that you open files in `binary mode`_.
This is because Requests may attempt to provide the
``Content-Length`` header for you, and if it does this value will
be set to the number of *bytes* in the file. Errors may occur if
you open the file in *text mode*.
.. _binary mode: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files
.. warning:: It is strongly recommended that you open files in :ref:`binary
mode <tut-files>`. This is because Requests may attempt to provide
the ``Content-Length`` header for you, and if it does this value
will be set to the number of *bytes* in the file. Errors may occur
if you open the file in *text mode*.
.. _event-hooks:
+5 -7
View File
@@ -348,13 +348,11 @@ support this, but there is a separate package which does -
For sending multiple files in one request refer to the :ref:`advanced <advanced>`
section.
.. warning:: It is strongly recommended that you open files in `binary mode`_.
This is because Requests may attempt to provide the
``Content-Length`` header for you, and if it does this value will
be set to the number of *bytes* in the file. Errors may occur if
you open the file in *text mode*.
.. _binary mode: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files
.. warning:: It is strongly recommended that you open files in :ref:`binary
mode <tut-files>`. This is because Requests may attempt to provide
the ``Content-Length`` header for you, and if it does this value
will be set to the number of *bytes* in the file. Errors may occur
if you open the file in *text mode*.
Response Status Codes