Skip to content

Commit 2fa14d4

Browse files
miss-islingtonmblahayambv
authored
[3.11] pythongh-48241: Clarify URL needs to be encoded when provided to urlopen and Request (pythonGH-103855) (python#103891)
(cherry picked from commit 44010d0) Co-authored-by: Michael Blahay <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
1 parent fffdbf4 commit 2fa14d4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Doc/library/urllib.request.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ The :mod:`urllib.request` module defines the following functions:
2828

2929
.. function:: urlopen(url, data=None[, timeout], *, cafile=None, capath=None, cadefault=False, context=None)
3030

31-
Open the URL *url*, which can be either a string or a
32-
:class:`Request` object.
31+
Open *url*, which can be either a string containing a valid, properly
32+
encoded URL, or a :class:`Request` object.
3333

3434
*data* must be an object specifying additional data to be sent to the
3535
server, or ``None`` if no such data is needed. See :class:`Request`
@@ -192,7 +192,7 @@ The following classes are provided:
192192

193193
This class is an abstraction of a URL request.
194194

195-
*url* should be a string containing a valid URL.
195+
*url* should be a string containing a valid, properly encoded URL.
196196

197197
*data* must be an object specifying additional data to send to the
198198
server, or ``None`` if no such data is needed. Currently HTTP
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarifying documentation about the url parameter to urllib.request.urlopen and urllib.request.Requst needing to be encoded properly.

0 commit comments

Comments
 (0)