Skip to content

Improved replacement functionality for deprecated crypt module #96747

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

Closed
gstein opened this issue Sep 11, 2022 · 2 comments
Closed

Improved replacement functionality for deprecated crypt module #96747

gstein opened this issue Sep 11, 2022 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir easy

Comments

@gstein
Copy link

gstein commented Sep 11, 2022

Documentation

The crypt module is deprecated for 3.11. At the top of the doc page (https://docs.python.org/3/library/crypt.html), it suggests that maybe hashlib can provide a replacement, or PEP 594. Neither of these were very helpful.

What I did find is passlib has a functional replacement. Please see: https://passlib.readthedocs.io/en/stable/lib/passlib.hash.md5_crypt.html

I think this package/module should be recommended in the crypt module documentation.

Note that passlib will use the OS crypt() function if available, and will default to a pure-python solution based on the (guaranteed) presence of the MD5 hashing library.

Linked PRs

@gstein gstein added the docs Documentation in the Doc dir label Sep 11, 2022
@hugovk
Copy link
Member

hugovk commented May 9, 2023

@gstein Sounds good, please could you create a PR to update the docs?

@hugovk hugovk added the easy label May 26, 2023
bityob added a commit to bityob/cpython that referenced this issue Jul 12, 2023
bityob added a commit to bityob/cpython that referenced this issue Jul 12, 2023
gpshead pushed a commit that referenced this issue Jul 12, 2023
…precation doc (GH-106660) (#106660)

* Added mention to passlib package as alternative to the deprecated crypt module.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 12, 2023
…pt` deprecation doc (pythonGH-106660) (pythonGH-106660)

* Added mention to passlib package as alternative to the deprecated crypt module.
(cherry picked from commit ec7b05a)

Co-authored-by: Yonatan Bitton <[email protected]>
gpshead pushed a commit that referenced this issue Jul 12, 2023
…ypt` deprecation doc (GH-106660) (GH-106660) (#106697)

[3.12] gh-96747: Mention the PyPI `passlib` package in the `crypt` deprecation doc (GH-106660) (GH-106660)

* Added mention to passlib package as alternative to the deprecated crypt module.
(cherry picked from commit ec7b05a)

Co-authored-by: Yonatan Bitton <[email protected]>
@gpshead
Copy link
Member

gpshead commented Jul 12, 2023

The 3.11 & 3.12 docs point to passlib as a possibility now. Several of us poked around passlib - it isn't perfect. It's maintainer hasn't been active since October 2020 (anywhere on PyPI) and it has a sole maintainer. If any of this ever proves to be a practical problem we'll remove the link from our docs. My own searching didn't obviously turn up other good replacement candidates though.

For the rare users who need old crypt functionality, it looks like it'll work for now. Another alternative would be for anyone to put a fork of 3.12's crypt module up on PyPI as its own package.

For many of these old rarely used in anything modern algorithms even someone offering up a pure python implementation would work just fine for people's intended purpose.

@gpshead gpshead closed this as completed Jul 12, 2023
@gpshead gpshead self-assigned this Jul 12, 2023
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 easy
Projects
None yet
Development

No branches or pull requests

3 participants