]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91217: deprecate crypt (GH-91459)
authorBrett Cannon <brett@python.org>
Tue, 12 Apr 2022 00:02:19 +0000 (17:02 -0700)
committerGitHub <noreply@github.com>
Tue, 12 Apr 2022 00:02:19 +0000 (17:02 -0700)
Doc/whatsnew/3.11.rst
Lib/crypt.py
Lib/test/test_crypt.py
Misc/NEWS.d/next/Library/2022-04-11-16-13-26.gh-issue-91217.2rf8rc.rst [new file with mode: 0644]

index cc358b4ffdb2acd5107efe6c3d0b4f33040d14aa..354e2112338db26f349e6f1619bad8c916c4224d 100644 (file)
@@ -851,6 +851,7 @@ Deprecated
   * :mod:`cgi`
   * :mod:`cgitb`
   * :mod:`chunk`
+  * :mod:`crypt`
 
   (Contributed by Brett Cannon in :issue:`47061`.)
 
index 33dbc46bb3e96bed9f32f7919c81cfda069b65ce..46c3de8474bf1cba7b81cb524b3570879554e4d3 100644 (file)
@@ -12,10 +12,14 @@ except ModuleNotFoundError:
 
 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()
 
index 877c575c5534ae76bdfec11f85394bb1f29a6ee6..b2a5ce6db0919503fe6de51951bee33873232747 100644 (file)
@@ -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':
diff --git a/Misc/NEWS.d/next/Library/2022-04-11-16-13-26.gh-issue-91217.2rf8rc.rst b/Misc/NEWS.d/next/Library/2022-04-11-16-13-26.gh-issue-91217.2rf8rc.rst
new file mode 100644 (file)
index 0000000..067783f
--- /dev/null
@@ -0,0 +1 @@
+Deprecate the crypt module.