Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9e87f3d7
Commit
9e87f3d7
authored
Nov 26, 2015
by
Martin Panter
Browse files
Options
Browse Files
Download
Plain Diff
Issue #22989, #21228: Merge urlopen() doc from 3.4 into 3.5
parents
077e36af
747d48cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
Doc/library/urllib.request.rst
Doc/library/urllib.request.rst
+13
-7
Misc/ACKS
Misc/ACKS
+1
-0
No files found.
Doc/library/urllib.request.rst
View file @
9e87f3d7
...
@@ -59,13 +59,7 @@ The :mod:`urllib.request` module defines the following functions:
...
@@ -59,13 +59,7 @@ The :mod:`urllib.request` module defines the following functions:
The *cadefault* parameter is ignored.
The *cadefault* parameter is ignored.
For http and https urls, this function returns a
This function always returns an object which can work as
:class:`http.client.HTTPResponse` object which has the following
:ref:`httpresponse-objects` methods.
For ftp, file, and data urls and requests explicitly handled by legacy
:class:`URLopener` and :class:`FancyURLopener` classes, this function
returns a :class:`urllib.response.addinfourl` object which can work as
:term:`context manager` and has methods such as
:term:`context manager` and has methods such as
* :meth:`~urllib.response.addinfourl.geturl` --- return the URL of the resource retrieved,
* :meth:`~urllib.response.addinfourl.geturl` --- return the URL of the resource retrieved,
...
@@ -77,6 +71,18 @@ The :mod:`urllib.request` module defines the following functions:
...
@@ -77,6 +71,18 @@ The :mod:`urllib.request` module defines the following functions:
* :meth:`~urllib.response.addinfourl.getcode` -- return the HTTP status code of the response.
* :meth:`~urllib.response.addinfourl.getcode` -- return the HTTP status code of the response.
For http and https urls, this function returns a
:class:`http.client.HTTPResponse` object slightly modified. In addition
to the three new methods above, the msg attribute contains the
same information as the :attr:`~http.client.HTTPResponse.reason`
attribute --- the reason phrase returned by server --- instead of
the response headers as it is specified in the documentation for
:class:`~http.client.HTTPResponse`.
For ftp, file, and data urls and requests explicitly handled by legacy
:class:`URLopener` and :class:`FancyURLopener` classes, this function
returns a :class:`urllib.response.addinfourl` object.
Raises :exc:`~urllib.error.URLError` on errors.
Raises :exc:`~urllib.error.URLError` on errors.
Note that ``None`` may be returned if no handler handles the request (though
Note that ``None`` may be returned if no handler handles the request (though
...
...
Misc/ACKS
View file @
9e87f3d7
...
@@ -443,6 +443,7 @@ Arnaud Fontaine
...
@@ -443,6 +443,7 @@ Arnaud Fontaine
Michael Foord
Michael Foord
Amaury Forgeot d'Arc
Amaury Forgeot d'Arc
Doug Fort
Doug Fort
Evens Fortuné
Chris Foster
Chris Foster
John Fouhy
John Fouhy
Andrew Francis
Andrew Francis
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment