Skip to content

Commit aa39c1a

Browse files
lysnikolaouzhangyangyu
authored andcommitted
[2.7] bpo-32804: Include the context parameter in urlretrieve documentation (GH-10203)
1 parent 05acd44 commit aa39c1a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Doc/library/urllib.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,15 @@ High-level interface
147147
:envvar:`no_proxy` environment variable.
148148

149149
.. versionchanged:: 2.7.9
150-
The *context* parameter was added. All the neccessary certificate and hostname checks are done by default.
150+
The *context* parameter was added. All the neccessary certificate and hostname
151+
checks are done by default.
151152

152153
.. deprecated:: 2.6
153154
The :func:`urlopen` function has been removed in Python 3 in favor
154155
of :func:`urllib2.urlopen`.
155156

156157

157-
.. function:: urlretrieve(url[, filename[, reporthook[, data]]])
158+
.. function:: urlretrieve(url[, filename[, reporthook[, data[, context]]]])
158159

159160
Copy a network object denoted by a URL to a local file, if necessary. If the URL
160161
points to a local file, or a valid cached copy of the object exists, the object
@@ -179,6 +180,10 @@ High-level interface
179180
:mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
180181
function below.
181182

183+
The *context* parameter may be set to a :class:`ssl.SSLContext` instance to
184+
configure the SSL settings that are used if :func:`urlretrieve` makes a HTTPS
185+
connection.
186+
182187
.. versionchanged:: 2.5
183188
:func:`urlretrieve` will raise :exc:`ContentTooShortError` when it detects that
184189
the amount of data available was less than the expected amount (which is the
@@ -196,6 +201,10 @@ High-level interface
196201
the size of the data it has downloaded, and just returns it. In this case you
197202
just have to assume that the download was successful.
198203

204+
.. versionchanged:: 2.7.9
205+
The *context* parameter was added. All the neccessary certificate and hostname
206+
checks are done by default.
207+
199208

200209
.. data:: _urlopener
201210

@@ -349,6 +358,10 @@ URL Opener objects
349358
:class:`URLopener` objects will raise an :exc:`IOError` exception if the server
350359
returns an error code.
351360

361+
.. versionchanged:: 2.7.9
362+
The *context* parameter was added. All the neccessary certificate and hostname
363+
checks are done by default.
364+
352365
.. method:: open(fullurl[, data])
353366

354367
Open *fullurl* using the appropriate protocol. This method sets up cache and

0 commit comments

Comments
 (0)