GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-104773: PEP 594: Remove the crypt module by vstinner · Pull Request #104908 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented May 24, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Remove the crypt module and its private _crypt extension, deprecated in Python 3.11.

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
vstinner requested review from corona10 and erlend-aasland as code owners May 24, 2023 23:26
@bedevere-bot bedevere-bot added the awaiting core review label May 24, 2023
@bedevere-bot bedevere-bot mentioned this pull request May 24, 2023
PEP 594: Remove stdlib modules scheduled for deletion in Python 3.13 #104773
Closed
19 tasks done
@vstinner

vstinner commented May 24, 2023

Copy link
Copy Markdown
Member Author

Using ^\s*(import crypt\b|from crypt\b) regex, I found the following PyPI top 5,000 projects using the removed crypt module.

Affected projects (8):

  • Django (4.2)
  • Twisted (22.10.0)
  • ansible (7.4.0)
  • ansible-core (2.14.4)
  • htpasswd (2.3)
  • passlib (1.7.4)
  • pyftpdlib (1.5.7)
  • pytest-testinfra (7.0.0)
Details Code:
Django-4.2/tests/auth_tests/test_hashers.py: import crypt
ansible-7.4.0/ansible_collections/community/general/plugins/modules/homectl.py: import crypt
ansible-7.4.0/ansible_collections/community/general/plugins/modules/udm_user.py: import crypt
Twisted-22.10.0/src/twisted/conch/test/test_checkers.py: import crypt
Twisted-22.10.0/src/twisted/cred/test/test_cred.py: from crypt import crypt as _crypt
Twisted-22.10.0/src/twisted/plugins/cred_unix.py: import crypt
ansible-core-2.14.4/lib/ansible/utils/encrypt.py: import crypt
passlib-1.7.4/passlib/tests/utils.py: from crypt import crypt
passlib-1.7.4/passlib/utils/__init__.py: from crypt import crypt as _crypt
pyftpdlib-1.5.7/pyftpdlib/authorizers.py: import crypt
pytest-testinfra-7.0.0/test/test_modules.py: import crypt
htpasswd-2.3/htpasswd/basic.py: from crypt import crypt
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented May 24, 2023

Copy link
Copy Markdown
Member Author

passlib (1.7.4)

It's interesting that the proposed replacement for the removed crypt module actually uses crypt internally (in /passlib/utils/__init__.py) :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

zware
zware approved these changes May 25, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels May 25, 2023
@hugovk

hugovk commented May 25, 2023

Copy link
Copy Markdown
Member

Are these bits still needed?

Lib/ctypes/util.py
366:            print(f"crypt\t:: {find_library('crypt')}")
367:            print(f"crypt\t:: {cdll.LoadLibrary(find_library('crypt'))}")
373:            print(find_library("crypt"))
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
pythongh-104773: PEP 594: Remove the crypt module
640eea3
Remove the crypt module and its private _crypt extension, deprecated
in Python 3.11.
@vstinner
vstinner force-pushed the remove_crypt branch from b9ae871 to 640eea3 Compare May 25, 2023 12:28
@vstinner

vstinner commented May 25, 2023

Copy link
Copy Markdown
Member Author

Are these bits still needed?

IMO we should keep it. I saw this test in ctypes. I don't see any direct relationship with the Python crypt module. It's just a test to load a dynamic library which is commonly available on Unix.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@corona10

corona10 commented May 25, 2023

Copy link
Copy Markdown
Member

image

hugovk, vstinner, and Hobeom reacted with laugh emoji
All reactions
  • 😄 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk
hugovk approved these changes May 25, 2023
View reviewed changes
@vstinner
vstinner merged commit e4127ea into python:main May 25, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label May 25, 2023
@vstinner
vstinner deleted the remove_crypt branch May 25, 2023 13:47
@Ahajha Ahajha mentioned this pull request Nov 29, 2024
cpython: add 3.13.1 conan-io/conan-center-index#25536
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes
@zware zware zware approved these changes
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@corona10 corona10 Awaiting requested review from corona10 corona10 is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@vstinner @hugovk @corona10 @zware @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.