Skip to content

Commit 52ecc9c

Browse files
committed
Fix dead URLs in urllib documentation
Replace dead/broken URLs in urllib documentation: - urllib.request.rst: Replace musi-cal.com (503) with python.org/search for GET example - urllib.request.rst: Replace requestb.in (403) with httpbin.org/post for POST example - urllib.robotparser.rst: Replace robotstxt.org/orig.html with RFC 9309 reference, which is the authoritative IETF standard for robots.txt
1 parent 618b726 commit 52ecc9c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/urllib.request.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ containing parameters::
13861386
>>> import urllib.request
13871387
>>> import urllib.parse
13881388
>>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
1389-
>>> url = "http://www.musi-cal.com/cgi-bin/query?%s" % params
1389+
>>> url = "https://www.python.org/search?%s" % params
13901390
>>> with urllib.request.urlopen(url) as f:
13911391
... print(f.read().decode('utf-8'))
13921392
...
@@ -1398,7 +1398,7 @@ from urlencode is encoded to bytes before it is sent to urlopen as data::
13981398
>>> import urllib.parse
13991399
>>> data = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
14001400
>>> data = data.encode('ascii')
1401-
>>> with urllib.request.urlopen("http://requestb.in/xrbl82xr", data) as f:
1401+
>>> with urllib.request.urlopen("https://httpbin.org/post", data) as f:
14021402
... print(f.read().decode('utf-8'))
14031403
...
14041404

Doc/library/urllib.robotparser.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
This module provides a single class, :class:`RobotFileParser`, which answers
1919
questions about whether or not a particular user agent can fetch a URL on the
2020
website that published the :file:`robots.txt` file. For more details on the
21-
structure of :file:`robots.txt` files, see http://www.robotstxt.org/orig.html.
21+
structure of :file:`robots.txt` files, see :rfc:`9309`.
2222

2323

2424
.. class:: RobotFileParser(url='')

0 commit comments

Comments
 (0)