8000 gh-130283: update deprecated links and examples in `urllib.request` docs by Mr-Sunglasses · Pull Request #130284 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-130283: update deprecated links and examples in urllib.request docs #130284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Prev Previous commit
Next Next commit
docs: fix the ". ::" sentences and merge them into "::" directly
  • Loading branch information
Mr-Sunglasses committed Mar 9, 2025
commit 2b066f74ec49218348713e6bfdeeb6bd3683f10c
6 changes: 3 additions & 3 deletions Doc/library/urllib.request.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ In addition to the examples below, more examples are given in
:ref:`urllib-howto`.

This example gets the python.org main page and displays the first 300 bytes of
it. ::
it::

>>> import urllib.request
>>> with urllib.request.urlopen('http://www.python.org/') as f:
Expand All @@ -1232,7 +1232,7 @@ the various ways in which an HTML document could have specified its
encoding information.

As the python.org website uses *utf-8* encoding as specified in its meta tag, we
will use the same for decoding the bytes object. ::
will use the same for decoding the bytes object::

>>> with urllib.request.urlopen('http://www.python.org/') as f:
... print(f.read(100).decode('utf-8'))
Expand All @@ -1242,7 +1242,7 @@ will use the same for decoding the bytes object. ::
<!-

It is also possible to achieve the same result without using the
:term:`context manager` approach. ::
:term:`context manager` approach::

>>> import urllib.request
>>> f = urllib.request.urlopen('http://www.python.org/')
Expand Down
0