summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncio/locks.py2
-rwxr-xr-xLib/trace.py2
-rw-r--r--Lib/urllib/request.py17
3 files changed, 13 insertions, 8 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index 1804d7b..842d621 100644
--- a/Lib/asyncio/locks.py
+++ b/Lib/asyncio/locks.py
@@ -111,7 +111,7 @@ class Lock(_ContextManagerMixin):
acquire() is a coroutine and should be called with 'yield from'.
Locks also support the context management protocol. '(yield from lock)'
- should be used as context manager expression.
+ should be used as the context manager expression.
Usage:
diff --git a/Lib/trace.py b/Lib/trace.py
index 7afbe76..ae15461 100755
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -224,7 +224,7 @@ class CoverageResults:
:param show_missing: Show lines that had no hits.
:param summary: Include coverage summary per module.
- :param coverdir: If None, the results of each module are placed in it's
+ :param coverdir: If None, the results of each module are placed in its
directory, otherwise it is included in the directory
specified.
"""
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 333c3f2..67e73f9 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -172,8 +172,8 @@ def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
The *cadefault* parameter is ignored.
- For http and https urls, this function returns a http.client.HTTPResponse
- object which has the following HTTPResponse Objects methods:
+ This function always returns an object which can work as a context
+ manager and has methods such as
* geturl() - return the URL of the resource retrieved, commonly used to
determine if a redirect was followed
@@ -185,12 +185,17 @@ def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
* getcode() - return the HTTP status code of the response. Raises URLError
on errors.
- For ftp, file, and data urls and requests explicitly handled by legacy
+ For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
+ object slightly modified. In addition to the three new methods above, the
+ msg attribute contains the same information as the reason attribute ---
+ the reason phrase returned by the server --- instead of the response
+ headers as it is specified in the documentation for HTTPResponse.
+
+ For FTP, file, and data URLs and requests explicitly handled by legacy
URLopener and FancyURLopener classes, this function returns a
- urllib.response.addinfourl object which can work as context manager and
- also support the geturl(), info(), getcode() methods listed above.
+ urllib.response.addinfourl object.
- 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
the default installed global OpenerDirector uses UnknownHandler to ensure
this never happens).