This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [doc] Broken URL in "Brief Tour of the Standard Library"
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: docs@python, miss-islington, rhettinger, vivekvashist
Priority: normal Keywords: patch

Created on 2021-12-15 06:10 by vivekvashist, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30315 merged rhettinger, 2022-01-01 01:44
PR 30328 merged miss-islington, 2022-01-01 17:50
PR 30329 merged miss-islington, 2022-01-01 17:50
Messages (7)
msg408585 - (view) Author: Vivek Vashist (vivekvashist) * Date: 2021-12-15 06:10
URL: http://tycho.usno.navy.mil/cgi-bin/timer.pl is broken in the example 
https://docs.python.org/3/tutorial/stdlib.html#internet-access

> curl -v http://tycho.usno.navy.mil/cgi-bin/timer.pl
* Could not resolve host: tycho.usno.navy.mil
* Closing connection 0
curl: (6) Could not resolve host: tycho.usno.navy.mil
msg408647 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2021-12-15 21:04
This seems to be a temporary outage, expected to be restored in the first half of 2022.  Source:  https://www.usno.navy.mil/USNO/time/master-clock

I'll look for an alternative time source that is currently online.
msg409407 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2021-12-31 05:34
I'm thinking of this an a replacement example:

>>> import json
>>> import urllib.request
>>> url = "http://worldtimeapi.org/api/timezone/America/Los_Angeles"
>>> with urllib.request.urlopen(url) as response:
...     timeinfo = json.load(response)
...
>>> print(timeinfo['datetime'])
2021-12-30T21:32:08.588278-08:00
msg409409 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2021-12-31 08:24
This is a little closer to the current code.  Also it has a simpler and more universal url.


from urllib.request import urlopen
url = 'http://worldtimeapi.org/api/timezone/etc/UTC.txt'
with urlopen(url) as request:
    for line in request:
        line = line.decode('utf-8')
        if line.startswith('datetime'):
            print(line)

datetime: 2021-12-31T08:23:15.083004+00:00
msg409466 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-01-01 17:50
New changeset ac4eea21722d9ed1604c9c30a8d29ae2ce74f1b2 by Raymond Hettinger in branch 'main':
bpo-46079: Replace external link that is down for maintenance. (GH-30315)
https://github.com/python/cpython/commit/ac4eea21722d9ed1604c9c30a8d29ae2ce74f1b2
msg409467 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-01-01 18:13
New changeset 2bd73546959619b2519a7a830b3aaf190abeaf78 by Miss Islington (bot) in branch '3.10':
bpo-46079: Replace external link that is down for maintenance. (GH-30315) (GH-30328)
https://github.com/python/cpython/commit/2bd73546959619b2519a7a830b3aaf190abeaf78
msg409468 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-01-01 18:13
New changeset 72ffcb02f3ea6efcd3afe368996dc3ee89701898 by Miss Islington (bot) in branch '3.9':
bpo-46079: Replace external link that is down for maintenance. (GH-30315) (GH-30329)
https://github.com/python/cpython/commit/72ffcb02f3ea6efcd3afe368996dc3ee89701898
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90237
2022-01-01 18:14:14rhettingersetpriority: low -> normal
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-01-01 18:13:34rhettingersetmessages: + msg409468
2022-01-01 18:13:12rhettingersetmessages: + msg409467
2022-01-01 17:50:16miss-islingtonsetpull_requests: + pull_request28544
2022-01-01 17:50:12miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request28543
2022-01-01 17:50:03rhettingersetmessages: + msg409466
2022-01-01 01:44:16rhettingersetkeywords: + patch
stage: patch review
pull_requests: + pull_request28532
2021-12-31 08:24:59rhettingersetmessages: + msg409409
2021-12-31 05:34:50rhettingersetmessages: + msg409407
2021-12-15 21:04:22rhettingersetpriority: normal -> low

nosy: + rhettinger
messages: + msg408647

assignee: docs@python -> rhettinger
2021-12-15 08:33:37AlexWaygoodsettitle: Broken URL in tutorial -> [doc] Broken URL in "Brief Tour of the Standard Library"
type: behavior
versions: + Python 3.9, Python 3.11
2021-12-15 06:10:31vivekvashistcreate