Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docs: re-create pages for removed modules to document their removal.#126622

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nedbat merged 9 commits intopython:mainfromnedbat:nedbat/document-dead-batteries
Nov 11, 2024

Conversation

@nedbat
Copy link
Member

@nedbatnedbat commentedNov 9, 2024
edited
Loading

This shows just two modules as an example. Will flesh it out with the rest of PEP 594 if people like the approach.
This adds a "Removed modules" page that lists modules which have been removed. Each module gets a page (with the original URL) that explains why the module is gone.

Will also need to change the redirects that were created here:https://github.com/python/psf-salt/pull/521/files

Things to notice:

  • A new "Removed modules" section, but it doesn't list all the modules in the main table of contents.
  • Links are provided to PyPI alternatives
  • Where existing suggested replacements text was available, I've put it on the removed module page.
  • The modules are still listed in the index, but as: "Deprecated: Removed in Python 3.13"
  • When the modules were first removed, existing mentions in What's New pages were changed to not try to link to the missing pages. I haven't restored those links, and am torn about whether it is worthwhile.

📚 Documentation preview 📚:https://cpython-previews--126622.org.readthedocs.build/

hartwork and ncoghlan reacted with thumbs up emoji
This shows just two modules as an example.  Will flesh it out with therest of PEP 594 if people like the approach.Will also need to change the redirects that were created here:https://github.com/python/psf-salt/pull/521/files
@bedevere-appbedevere-appbot added docsDocumentation in the Doc dir skip news labelsNov 9, 2024
@defnull
Copy link

defnull commentedNov 9, 2024
edited
Loading

Please re-evaluate if recommendingemail for parsingmultipart/form-data is really a good idea. It has many problems, some of which may impact security of web applications:

  • There is no documentation how to actually parsemultipart/form-data (e.g. from a WSGI environment) withemail. The parser expects messages to begin withMIME-Version: 1.0 and a matchingContent-Type header, which is not the case for an HTTP request. The header with the boundary is part of the HTTP headers, not the request payload. Getting this to work with a WSGI or ASGI payload is not obvious and hard to get right.
  • email is way to forgiving and accepts way more than just RFC7578multipart/form-data. For example: nested multipart, invalid line breaks, invalid content disposition types, segments with missing required headers, and a ton of other stuff that may be required for email parsing but should immediately be rejected when parsingmultipart/form-data streams. That makes the email parser complex and slow (compared to a more focused parser) and intorduces a lot of surface area for potential security issues when used to parse web application user input.
  • Theemail parser holds everything in memory by default, which is fine for emails but very problematic when parsing potentially large file uploads.
  • Theemail parser is dangerously slow for specifically crafted input. So slow that it can be used as a denial of service attack against websites using it to parse user input. I won't go into details here, for obvious reasons.

Disclaimer: I'm the author of the multipart library.

hartwork reacted with thumbs up emoji

@nineteendo
Copy link
Contributor

I think a warning would stand out more than this:

Screenshot 2024-11-09 at 18 04 16
hartwork reacted with thumbs up emoji

@nedbat
Copy link
MemberAuthor

Please re-evaluate if recommending email for parsing multipart/form-data is really a good idea. It has many problems, some of which may impact security of web applications:

Thanks. I copied those recommendations from the What's New section when the module was removed. I can omit this part of the page and let people find other advice to follow.

We should also make clear (as someone mentioned in Discourse) that the PyPI packages are third-party, not maintained by the CPython team.

I think a warning would stand out more than this:

I'm not sure how else you would like it to be mentioned. The first sentence (and soon one of the only sentences) is very clear.

@nineteendo
Copy link
Contributor

I'm not sure how else you would like it to be mentioned.

I would just like it to stand out more by using theversionremoved,warning directive or another admonition.

@nedbatnedbatforce-pushed thenedbat/document-dead-batteries branch from77a7a09 to7fcf162CompareNovember 9, 2024 20:15
@nedbat
Copy link
MemberAuthor

I'm not sure how else you would like it to be mentioned.

I would just like it to stand out more by using theversionremoved,warning directive or another admonition.

I've added the.. deprecated-removed: directive to each page.

nineteendo and ncoghlan reacted with thumbs up emoji

@nedbat
Copy link
MemberAuthor

I've added the rest of the PEP 594 modules. Any last concerns?

defnull reacted with thumbs up emoji

@nedbatnedbat marked this pull request as ready for reviewNovember 10, 2024 16:47
@nedbatnedbat requested review froma team andethanfurman ascode ownersNovember 10, 2024 16:47
@effigies
Copy link
Contributor

Any chance of adding distutils (PEP 632)?

@nedbat
Copy link
MemberAuthor

I guess alsoimp?

effigies reacted with thumbs up emoji

@effigies
Copy link
Contributor

Ah, yeah,imp would be good, too. I don't think it got a PEP, so I didn't see it grepping through the list.

@nedbat
Copy link
MemberAuthor

I've added distutils and imp.


This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.12 <whatsnew312-removed>` after
being deprecated in Python 3.4.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

No mention of importlib as replacement?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good point. I added a mention that the removal notice on the What's New page includes the migration advice.

merwok reacted with thumbs up emoji
@nedbatnedbatforce-pushed thenedbat/document-dead-batteries branch from66784f8 to002be87CompareNovember 11, 2024 13:19
@nedbatnedbat changed the titleDocs: re-create cgi and cgitb pages to document their removal.Docs: re-create pages for removed modules to document their removal.Nov 11, 2024
@nedbatnedbat merged commit036930d intopython:mainNov 11, 2024
25 checks passed
@nedbatnedbat deleted the nedbat/document-dead-batteries branchNovember 11, 2024 22:54
@nedbatnedbat added the needs backport to 3.13bugs and security fixes labelNov 12, 2024
@miss-islington-app
Copy link

Thanks@nedbat for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestNov 12, 2024
…ythonGH-126622)Will also need to change the redirects that were created here:https://github.com/python/psf-salt/pull/521/files(cherry picked from commit036930d)Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
@bedevere-app
Copy link

GH-126709 is a backport of this pull request to the3.13 branch.

@AA-Turner
Copy link
Member

@nedbat do you intend to backport this to 3.12? Otherwise we shall need to retain the redirects for asynchat, asyncore, and smtpd in the 3.12 documentation only.

A

@nedbat
Copy link
MemberAuthor

Most of the modules were removed in 3.13, so it's better to leave 3.12 as it is.

@AA-Turner
Copy link
Member

There are ~5 from 3.12, so I'd say it's worth considering if the 'version switcher' case is to be useful -- but if not I shall update the redirects PR accordingly.

A

merwok reacted with thumbs up emoji

@nedbat
Copy link
MemberAuthor

The modules removed in 3.12 as asynchat, asyncore, distutils, imp, and smtpd. To make those behave correctly, we'd need a new PR for the docs that we'd only apply to the 3.12 branch, correct?

merwok reacted with thumbs up emoji

@AA-Turner
Copy link
Member

I don't think you'd need a new PR, just backporting this one and deleting the PEP 594 changes should work, I believe. Though maybe avoiding cherry picker would be less work, I'm not sure.

A

@nedbat
Copy link
MemberAuthor

#126781 has the changes needed for 3.12.

nedbat added a commit that referenced this pull requestNov 14, 2024
…moval, based onGH-126622 (#126781)[3.12] Docs: re-create pages for removed modules to document their removal, based on#126622
@dmitrijiks

This comment has been minimized.

hugovk pushed a commit that referenced this pull requestNov 17, 2024
…moval. (GH-126622) (#126709)Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
picnixz pushed a commit to picnixz/cpython that referenced this pull requestDec 8, 2024
ebonnal pushed a commit to ebonnal/cpython that referenced this pull requestJan 12, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@merwokmerwokmerwok approved these changes

@ethanfurmanethanfurmanAwaiting requested review from ethanfurman

Assignees

No one assigned

Labels

docsDocumentation in the Doc dirskip issue

Projects

Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@nedbat@defnull@nineteendo@effigies@AA-Turner@dmitrijiks@merwok

[8]ページ先頭

©2009-2025 Movatter.jp