Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ Deprecated
* :mod:`cgi`
* :mod:`cgitb`
* :mod:`chunk`
* :mod:`crypt`

(Contributed by Brett Cannon in :issue:`47061`.)

Expand Down
4 changes: 4 additions & 0 deletions Lib/crypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@

import errno
import string as _string
import warnings
from random import SystemRandom as _SystemRandom
from collections import namedtuple as _namedtuple


warnings._deprecated(__name__, remove=(3, 13))


_saltchars = _string.ascii_letters + _string.digits + './'
_sr = _SystemRandom()

Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_crypt.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import sys
import unittest
from test.support import check_sanitizer
from test.support import check_sanitizer, warnings_helper


try:
if check_sanitizer(address=True, memory=True):
raise unittest.SkipTest("The crypt module SEGFAULTs on ASAN/MSAN builds")
import crypt
crypt = warnings_helper.import_deprecated("crypt")
IMPORT_ERROR = None
except ImportError as ex:
if sys.platform != 'win32':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate the crypt module.