Skip to content
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

docs: fix deprecated or broken examples in urllib.request documentation. #130283

Closed
Mr-Sunglasses opened this issue Feb 18, 2025 · 2 comments · Fixed by #130284
Closed

docs: fix deprecated or broken examples in urllib.request documentation. #130283

Mr-Sunglasses opened this issue Feb 18, 2025 · 2 comments · Fixed by #130284
Labels
docs Documentation in the Doc dir

Comments

@Mr-Sunglasses
Copy link
Contributor

Mr-Sunglasses commented Feb 18, 2025

Documentation

While working on the issue #130132 , I encountered with some examples and I can see the W3C document is outdated with some examples of urllib.request.urlopen() in Example of urllib.request

These are following things I find which is outdated.

Also there are other which also need to be fixed:

ref. https://docs.python.org/3/library/urllib.request.html#examples

There are many example in urllib.request documentation that need to be updated as they no longer works as expected.

In the following example, we are sending a data-stream to the stdin of a CGI and reading the data it returns to us. Note that this example will only work when the Python installation supports SSL.

Use of Basic HTTP Authentication:

Linked PRs

@Mr-Sunglasses
Copy link
Contributor Author

I need small suggestion here, as https://www.w3.org/International/O-charset is deprecated by W3C, and it added these two suggestions in the page

You may want to try, instead, one of the following pages:
Handling character encodings in HTML and CSS (tutorial)
Declaring character encodings in HTML

I've added https://www.w3.org/International/questions/qa-html-encoding-declarations this one but we can add something other instead of this like

I would love to know the thought's of the fellow dev's

@Mr-Sunglasses Mr-Sunglasses changed the title docs: Outdated code and links in Example of urllib.request docs: Outdated code and W3C link in first Example of urllib.request Feb 20, 2025
@Mr-Sunglasses Mr-Sunglasses changed the title docs: Outdated code and W3C link in first Example of urllib.request docs: fix deprecated or broken examples in urllib.request documentation. Feb 20, 2025
picnixz added a commit that referenced this issue Mar 23, 2025
…ocs (#130284)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 23, 2025
…est` docs (pythonGH-130284)

(cherry picked from commit fd459b1)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 23, 2025
…est` docs (pythonGH-130284)

(cherry picked from commit fd459b1)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz added a commit that referenced this issue Mar 23, 2025
…uest` docs (GH-130284) (#131626)

gh-130283: update deprecated links and examples in `urllib.request` docs (GH-130284)
(cherry picked from commit fd459b1)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz added a commit that referenced this issue Mar 23, 2025
…uest` docs (GH-130284) (#131627)

gh-130283: update deprecated links and examples in `urllib.request` docs (GH-130284)
(cherry picked from commit fd459b1)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@picnixz
Copy link
Member

picnixz commented Mar 23, 2025

Thanks for the report and the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants