-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
bpo-17258: Add requires_hashdigest to multiprocessing tests #20412
Conversation
Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked. Signed-off-by: Christian Heimes <christian@python.org>
Signed-off-by: Christian Heimes <christian@python.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the fix manually: it works! I removed md5 support, test_multiprocessing_spawn and test_concurrent_futures pass as expected.
Remove MD5 support, remove the builtin md5 module:
find -name "*md5*.so" -delete
Apply patch:
diff --git a/Lib/hashlib.py b/Lib/hashlib.py
index 1b6e50247c..0ec64e1a5f 100644
--- a/Lib/hashlib.py
+++ b/Lib/hashlib.py
@@ -55,7 +55,7 @@ More condensed:
# This tuple and __get_builtin_constructor() must be modified if a new
# always available algorithm is added.
-__always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512',
+__always_supported = ('sha1', 'sha224', 'sha256', 'sha384', 'sha512',
'blake2b', 'blake2s',
'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512',
'shake_128', 'shake_256')
diff --git a/Lib/test/support/hashlib_helper.py b/Lib/test/support/hashlib_helper.py
index a28132a565..a2bb7ee187 100644
--- a/Lib/test/support/hashlib_helper.py
+++ b/Lib/test/support/hashlib_helper.py
@@ -29,7 +29,7 @@ def requires_hashdigest(digestname, openssl=None, usedforsecurity=True):
_hashlib.new(digestname, usedforsecurity=usedforsecurity)
else:
hashlib.new(digestname, usedforsecurity=usedforsecurity)
- except ValueError:
+ except (ValueError, AttributeError):
raise unittest.SkipTest(
f"hash digest '{digestname}' is not available."
)
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index 0b2ef95a6f..7fa876d565 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -1842,7 +1842,6 @@ static struct PyMethodDef EVP_functions[] = {
_HASHLIB_GET_FIPS_MODE_METHODDEF
_HASHLIB_HMAC_SINGLESHOT_METHODDEF
_HASHLIB_HMAC_NEW_METHODDEF
- _HASHLIB_OPENSSL_MD5_METHODDEF
_HASHLIB_OPENSSL_SHA1_METHODDEF
_HASHLIB_OPENSSL_SHA224_METHODDEF
_HASHLIB_OPENSSL_SHA256_METHODDEF
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
I reported the miss-islington issue to python/miss-islington#342 |
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
GH-20626 is a backport of this pull request to the 3.9 branch. |
…-20412) Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked. Signed-off-by: Christian Heimes <christian@python.org>
Skip some :mod:
multiprocessing
tests when MD5 hash digest is blocked.Signed-off-by: Christian Heimes christian@python.org
https://bugs.python.org/issue17258
Automerge-Triggered-By: @tiran