]> granicus.if.org Git - python/commitdiff
bpo-33604: Remove Pending from hmac Deprecation warning. (GH-7062)
authorMatthias Bussonnier <bussonniermatthias@gmail.com>
Tue, 22 May 2018 22:55:31 +0000 (15:55 -0700)
committerGregory P. Smith <greg@krypto.org>
Tue, 22 May 2018 22:55:31 +0000 (15:55 -0700)
bpo-33604: Bump removal notice from 3.6 to 3.8 and change PendingDeprecationWarning to DeprecationWarning as we had intended to do earlier...

Doc/library/hmac.rst
Lib/hmac.py
Lib/test/test_hmac.py
Misc/NEWS.d/next/Documentation/2018-05-22-11-47-14.bpo-33604.5YHTpz.rst [new file with mode: 0644]

index fcda86cf7978008513776504ec2cfd6f329bc226..731624ba94e335cac4014fe2c14b3e4138ed4fb0 100644 (file)
@@ -27,7 +27,7 @@ This module implements the HMAC algorithm as described by :rfc:`2104`.
       Parameter *msg* can be of any type supported by :mod:`hashlib`.
       Parameter *digestmod* can be the name of a hash algorithm.
 
-   .. deprecated:: 3.4
+   .. deprecated-removed:: 3.4 3.8
       MD5 as implicit default digest for *digestmod* is deprecated.
 
 
index 93c084e4ae8088f9c2638aa8341105822d5dec22..43b7212976372c4945b1718f16a0c6de00b88a83 100644 (file)
@@ -39,8 +39,8 @@ class HMAC:
                    A hashlib constructor returning a new hash object. *OR*
                    A hash name suitable for hashlib.new().
                    Defaults to hashlib.md5.
-                   Implicit default to hashlib.md5 is deprecated and will be
-                   removed in Python 3.6.
+                   Implicit default to hashlib.md5 is deprecated since Python
+                   3.4 and will be removed in Python 3.8.
 
         Note: key and msg must be a bytes or bytearray objects.
         """
@@ -50,7 +50,9 @@ class HMAC:
 
         if digestmod is None:
             _warnings.warn("HMAC() without an explicit digestmod argument "
-                           "is deprecated.", PendingDeprecationWarning, 2)
+                           "is deprecated since Python 3.4, and will be removed "
+                           "in 3.8",
+                           DeprecationWarning, 2)
             digestmod = _hashlib.md5
 
         if callable(digestmod):
index 4e4ef0ec0e866aa2670ee8a695ca58a92aecb1c4..7f490130763010adca6452d33cb16b5585df4e34 100644 (file)
@@ -12,7 +12,7 @@ def ignore_warning(func):
     def wrapper(*args, **kwargs):
         with warnings.catch_warnings():
             warnings.filterwarnings("ignore",
-                                    category=PendingDeprecationWarning)
+                                    category=DeprecationWarning)
             return func(*args, **kwargs)
     return wrapper
 
@@ -303,7 +303,7 @@ class TestVectorsTestCase(unittest.TestCase):
                 self.fail('Expected warning about small block_size')
 
     def test_with_digestmod_warning(self):
-        with self.assertWarns(PendingDeprecationWarning):
+        with self.assertWarns(DeprecationWarning):
             key = b"\x0b" * 16
             data = b"Hi There"
             digest = "9294727A3638BB1C13F48EF8158BFC9D"
diff --git a/Misc/NEWS.d/next/Documentation/2018-05-22-11-47-14.bpo-33604.5YHTpz.rst b/Misc/NEWS.d/next/Documentation/2018-05-22-11-47-14.bpo-33604.5YHTpz.rst
new file mode 100644 (file)
index 0000000..3c2f2d0
--- /dev/null
@@ -0,0 +1 @@
+Update HMAC md5 default to a DeprecationWarning, bump removal to 3.8.