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

PEP 594: Remove stdlib modules scheduled for deletion in Python 3.13 #104773

Closed
19 tasks done
vstinner opened this issue May 22, 2023 · 13 comments
Closed
19 tasks done

PEP 594: Remove stdlib modules scheduled for deletion in Python 3.13 #104773

vstinner opened this issue May 22, 2023 · 13 comments
Labels
3.13 bugs and security fixes

Comments

@vstinner
Copy link
Member

vstinner commented May 22, 2023

PEP 594 ("Removing dead batteries from the standard library") deprecated the following 19 modules in Python 3.11 (or before) and their removal in Python 3.13:

  • aifc
  • audioop
  • cgi
  • cgitb
  • chunk
  • crypt
  • imghdr
  • mailcap
  • msilib
  • nis
  • nntplib
  • ossaudiodev
  • pipes
  • sndhdr
  • spwd
  • sunau
  • telnetlib
  • uu
  • xdrlib

I propose to remove them as soon as possible in the Python 3.13 development cycle to help users to prepare for this incompatible change before Python 3.13 final release (scheduled for October 2024).

I plan to work on pull requests to remove these modules.

Linked PRs

vstinner added a commit to vstinner/cpython that referenced this issue May 22, 2023
Remove the Lib/test/sndhdrdata/ directory.
vstinner added a commit to vstinner/cpython that referenced this issue May 22, 2023
Remove the Lib/test/sndhdrdata/ directory.
vstinner added a commit to vstinner/cpython that referenced this issue May 22, 2023
vstinner added a commit to vstinner/cpython that referenced this issue May 22, 2023
Remove the Lib/test/sndhdrdata/ directory.
vstinner added a commit to vstinner/cpython that referenced this issue May 22, 2023
vstinner added a commit to vstinner/cpython that referenced this issue May 23, 2023
vstinner added a commit to vstinner/cpython that referenced this issue May 23, 2023
* Remove Lib/test/imghdrdata/ directory.
* Copy 5 pictures (gif, png, ppm, pgm, xbm) from removed
  Lib/test/imghdrdata/ to a new Lib/test/tkinterdata/ directory.
vstinner added a commit to vstinner/cpython that referenced this issue May 23, 2023
* Remove the Lib/test/imghdrdata/ directory.
* Copy 5 pictures (gif, png, ppm, pgm, xbm) from removed
  Lib/test/imghdrdata/ to a new Lib/test/tkinterdata/ directory.
vstinner added a commit to vstinner/cpython that referenced this issue May 23, 2023
vstinner added a commit to vstinner/cpython that referenced this issue May 23, 2023
test_pyclbr now long tests the cgi module.
vstinner added a commit to vstinner/cpython that referenced this issue May 23, 2023
test_pyclbr no longer tests the cgi module.
vstinner added a commit to vstinner/cpython that referenced this issue May 23, 2023
vstinner added a commit to vstinner/cpython that referenced this issue May 23, 2023
* Replace "cgi" with "!cgi" in the Sphinx documentation to avoid
  warnings on broken references.
* test_pyclbr no longer tests the cgi module.
@hugovk hugovk added the 3.13 bugs and security fixes label May 23, 2023
vstinner added a commit to vstinner/cpython that referenced this issue May 23, 2023
* Replace "cgi" with "!cgi" in the Sphinx documentation to avoid
  warnings on broken references.
* test_pyclbr no longer tests the cgi module.
vstinner added a commit to vstinner/cpython that referenced this issue May 24, 2023
* Replace "cgi" with "!cgi" in the Sphinx documentation to avoid
  warnings on broken references.
* test_pyclbr no longer tests the cgi module.
vstinner added a commit to vstinner/cpython that referenced this issue May 24, 2023
* Replace "cgi" with "!cgi" in the Sphinx documentation to avoid
  warnings on broken references.
* test_pyclbr no longer tests the cgi module.
vstinner added a commit that referenced this issue May 24, 2023
* Replace "cgi" with "!cgi" in the Sphinx documentation to avoid
  warnings on broken references.
* test_pyclbr no longer tests the cgi module.
vstinner added a commit to vstinner/cpython that referenced this issue May 24, 2023
Remove the Lib/test/sndhdrdata/ directory.
vstinner added a commit that referenced this issue May 24, 2023
Remove the Lib/test/sndhdrdata/ directory.
vstinner added a commit to vstinner/cpython that referenced this issue May 24, 2023
vstinner added a commit to vstinner/cpython that referenced this issue May 24, 2023
vstinner added a commit to vstinner/cpython that referenced this issue May 25, 2023
vstinner added a commit that referenced this issue May 25, 2023
vstinner added a commit to vstinner/cpython that referenced this issue May 25, 2023
* Remove the Lib/test/imghdrdata/ directory.
* Copy 5 pictures (gif, png, ppm, pgm, xbm) from removed
  Lib/test/imghdrdata/ to a new Lib/test/tkinterdata/ directory.
@vstinner
Copy link
Member Author

So far, 18 modules have been removed. Removing the last one, imghdr, breaks the Docs CI job: PR #104777. I proposed to increase the minimum Sphinx version to build the Python documentation: issue #104818.

vstinner added a commit to vstinner/cpython that referenced this issue May 26, 2023
* Remove the Lib/test/imghdrdata/ directory.
* Copy 5 pictures (gif, png, ppm, pgm, xbm) from removed
  Lib/test/imghdrdata/ to a new Lib/test/tkinterdata/ directory.
vstinner added a commit to vstinner/cpython that referenced this issue May 26, 2023
* Remove the Lib/test/imghdrdata/ directory.
* Copy 5 pictures (gif, png, ppm, pgm, xbm) from removed
  Lib/test/imghdrdata/ to a new Lib/test/tkinterdata/ directory.
vstinner added a commit that referenced this issue May 26, 2023
* Remove the Lib/test/imghdrdata/ directory.
* Copy 5 pictures (gif, png, ppm, pgm, xbm) from removed
  Lib/test/imghdrdata/ to a new Lib/test/tkinterdata/ directory.
* Update Sphinx from 4.5 to 6.2 in Doc/requirements.txt.
@vstinner
Copy link
Member Author

Summary:

  • All modules scheduled for removal by PEP 594 have been removed in Python 3.12 and Python 3.13
  • The removal of the uu module makes 2 binascii functions useless and should be deprecated.
  • One minor thing that we missed in PEP 594 was the removal of the uu codec: https://peps.python.org/pep-0594/#uu-and-the-uu-encoding
  • I was wrong: we must not close all issues of removed modules, since bugs can still be fixed in Python 3.11 and 3.12: https://devguide.python.org/versions/

The remaining minor task related to the uu encoding is covered by PR #92758.

I'm not sure how to coordinate the work on helping third-party Python projects migrating to Python 3.13: move away from removed modules. But I prefer to not reuse this issue for this. Maybe discuss.python.org is a better place for that, since it's more visible than the Python bug tracker.

I created python/peps#3156 to mark PEP 594 as Final.

@vstinner
Copy link
Member Author

Thanks again to all reviewers of my PRs removing modules, especially @hugovk! Thanks @zware for handling msilib removal!

@vstinner
Copy link
Member Author

I created a discussion on discuss.python.org: PEP 594 has been implementated: Python 3.13 removes 20 stdlib modules.

vstinner added a commit to vstinner/cpython that referenced this issue May 31, 2023
cclauss added a commit to cclauss/filetype.py that referenced this issue May 11, 2024
The Python 3.13 release notes mention `filetype.py` as one of the alternatives for `imghdr` which was removed from the Standard Library so let's ensure that its test pass on Python 3.13 beta.

https://www.python.org/downloads/release/python-3130b1/

Raises `ModuleNotFoundError: No module named 'imghdr'` because Python 3.13 removes it from the Standard Library.
* https://docs.python.org/3/library/imghdr.html

> imghdr: use the projects [filetype](https://pypi.org/project/filetype/), [puremagic](https://pypi.org/project/puremagic/), or [python-magic](https://pypi.org/project/python-magic/) instead. (Contributed by Victor Stinner in [gh-104773](python/cpython#104773).)

https://docs.python.org/3.13/whatsnew/3.13.html#pep-594-dead-batteries-and-other-module-removals
cclauss added a commit to cclauss/puremagic that referenced this issue May 11, 2024
The Python 3.13 release notes mention `puremagic` as one of the alternatives for `imghdr` which was removed from the Standard Library so let's ensure that its tests pass on Python 3.13 beta.

https://www.python.org/downloads/release/python-3130b1/

May raise `ModuleNotFoundError: No module named 'imghdr'` because Python 3.13 removes it from the Standard Library.
* https://docs.python.org/3/library/imghdr.html

> imghdr: use the projects [filetype](https://pypi.org/project/filetype/), [puremagic](https://pypi.org/project/puremagic/), or [python-magic](https://pypi.org/project/python-magic/) instead. (Contributed by Victor Stinner in [gh-104773](python/cpython#104773).)

https://docs.python.org/3.13/whatsnew/3.13.html#pep-594-dead-batteries-and-other-module-removals
cclauss added a commit to cclauss/python-magic that referenced this issue May 11, 2024
The Python 3.13 release notes mention `python-magic` as one of the alternatives for `imghdr` which was removed from the Standard Library so let's ensure that its tests pass on Python 3.13 beta.

https://www.python.org/downloads/release/python-3130b1/

May raise `ModuleNotFoundError: No module named 'imghdr'` because Python 3.13 removes it from the Standard Library.
* https://docs.python.org/3/library/imghdr.html

> imghdr: use the projects [filetype](https://pypi.org/project/filetype/), [puremagic](https://pypi.org/project/puremagic/), or [python-magic](https://pypi.org/project/python-magic/) instead. (Contributed by Victor Stinner in [gh-104773](python/cpython#104773).)

https://docs.python.org/3.13/whatsnew/3.13.html#pep-594-dead-batteries-and-other-module-removals
ahupp pushed a commit to ahupp/python-magic that referenced this issue May 15, 2024
The Python 3.13 release notes mention `python-magic` as one of the alternatives for `imghdr` which was removed from the Standard Library so let's ensure that its tests pass on Python 3.13 beta.

https://www.python.org/downloads/release/python-3130b1/

May raise `ModuleNotFoundError: No module named 'imghdr'` because Python 3.13 removes it from the Standard Library.
* https://docs.python.org/3/library/imghdr.html

> imghdr: use the projects [filetype](https://pypi.org/project/filetype/), [puremagic](https://pypi.org/project/puremagic/), or [python-magic](https://pypi.org/project/python-magic/) instead. (Contributed by Victor Stinner in [gh-104773](python/cpython#104773).)

https://docs.python.org/3.13/whatsnew/3.13.html#pep-594-dead-batteries-and-other-module-removals
cclauss added a commit to cclauss/python-magic that referenced this issue May 20, 2024
The Python 3.13 release notes mention `python-magic` as one of the alternatives for `imghdr` which was removed from the Standard Library so let's ensure that its tests pass on Python 3.13 beta.

https://www.python.org/downloads/release/python-3130b1/

May raise `ModuleNotFoundError: No module named 'imghdr'` because Python 3.13 removes it from the Standard Library.
* https://docs.python.org/3/library/imghdr.html

> imghdr: use the projects [filetype](https://pypi.org/project/filetype/), [puremagic](https://pypi.org/project/puremagic/), or [python-magic](https://pypi.org/project/python-magic/) instead. (Contributed by Victor Stinner in [gh-104773](python/cpython#104773).)

https://docs.python.org/3.13/whatsnew/3.13.html#pep-594-dead-batteries-and-other-module-removals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes
Projects
None yet
Development

No branches or pull requests

4 participants