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
Bug in hashlib #50530
Comments
The try statement at the end of hashlib.py is some of the worst python Secondly, it seems flawed in function as well as form. try: to catch ImportError as well solves the problem for me. |
Can you propose an actual test case and a patch? |
If you're missing any hash algorithm from openssl (say sha224) and the Additionally, if no (or only some) openssl algorithms are available, the Producing a test case for these without mock objects is difficult at Here is a rewritten hashlib.py, without that ugly mess of code and |
In addition, I would replace |
Yes, I prefer: globals()[funcName] = __get_hash(funcName) The exec was used in the original code, I'm not aware of the style of I just wanted to blunt my words in the original post, I don't want |
That code was indeed a mess. I've incorporated most suggestions from Have you ever seen __get_builtin_constructor fail in practice? I can I've changed your code to log an error and continue rather than silently |
I have indeed seen __get_builtin_constructor fail in practice, in the But there is also the issue that Python is a language with many |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: