]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-48241: Clarify URL needs to be encoded when provided to urlopen and Request (...
authorMichael Blahay <mblahay@users.noreply.github.com>
Wed, 26 Apr 2023 20:52:23 +0000 (14:52 -0600)
committerGitHub <noreply@github.com>
Wed, 26 Apr 2023 20:52:23 +0000 (22:52 +0200)
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Doc/library/urllib.request.rst
Misc/NEWS.d/next/Documentation/2023-04-25-22-58-08.gh-issue-48241.l1Gxxh.rst [new file with mode: 0644]

index 64cc9c388ec30d044990e89c2f83a139c6d58bb8..1b05458280d8966c55e06f14589c7ddd4be21e02 100644 (file)
@@ -28,8 +28,8 @@ The :mod:`urllib.request` module defines the following functions:
 
 .. function:: urlopen(url, data=None[, timeout], *, cafile=None, capath=None, cadefault=False, context=None)
 
-   Open the URL *url*, which can be either a string or a
-   :class:`Request` object.
+   Open *url*, which can be either a string containing a valid, properly
+   encoded URL, or a :class:`Request` object.
 
    *data* must be an object specifying additional data to be sent to the
    server, or ``None`` if no such data is needed.  See :class:`Request`
@@ -192,7 +192,7 @@ The following classes are provided:
 
    This class is an abstraction of a URL request.
 
-   *url* should be a string containing a valid URL.
+   *url* should be a string containing a valid, properly encoded URL.
 
    *data* must be an object specifying additional data to send to the
    server, or ``None`` if no such data is needed.  Currently HTTP
diff --git a/Misc/NEWS.d/next/Documentation/2023-04-25-22-58-08.gh-issue-48241.l1Gxxh.rst b/Misc/NEWS.d/next/Documentation/2023-04-25-22-58-08.gh-issue-48241.l1Gxxh.rst
new file mode 100644 (file)
index 0000000..619505c
--- /dev/null
@@ -0,0 +1 @@
+Clarifying documentation about the url parameter to urllib.request.urlopen and urllib.request.Requst needing to be encoded properly.