[issue6281] Bug in hashlib

2009-09-14 Thread Daniel Eloff
Daniel Eloff added the comment: I have indeed seen __get_builtin_constructor fail in practice, in the python build in the Ubuntu repository if IIRC. I seem to recall the problem was that python was using a version of openssl that didn't include all of hash algorithms, probably because a pytho

[issue6281] Bug in hashlib

2009-08-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: That code was indeed a mess. I've incorporated most suggestions from your cleaned up version (and fixed a bug in it) in trunk r74479. Have you ever seen __get_builtin_constructor fail in practice? I can imagine that packing up a stripped down python interpr

[issue6281] Bug in hashlib

2009-06-14 Thread Daniel Eloff
Daniel Eloff added the comment: Yes, I prefer: globals()[funcName] = __get_hash(funcName) The exec was used in the original code, I'm not aware of the style of the python stdlib programmers, so I tried to be as true to what I found as possible. I just wanted to blunt my words in the original

[issue6281] Bug in hashlib

2009-06-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: In addition, I would replace exec funcName + ' = __get_hash(funcName)' with globals()[funcName] = __get_hash(funcName) -- nosy: +amaury.forgeotdarc ___ Python tracker

[issue6281] Bug in hashlib

2009-06-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: -> patch review versions: +Python 2.7, Python 3.1, Python 3.2 ___ Python tracker ___ ___ Python-

[issue6281] Bug in hashlib

2009-06-14 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> gregory.p.smith nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mail

[issue6281] Bug in hashlib

2009-06-14 Thread Daniel Eloff
Daniel Eloff added the comment: If you're missing any hash algorithm from openssl (say sha224) and the corresponding _sha224 module, hashlib will fail to import and no hash algorithms will be available. Additionally, if no (or only some) openssl algorithms are available, the error branch expect

[issue6281] Bug in hashlib

2009-06-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Can you propose an actual test case and a patch? -- nosy: +pitrou ___ Python tracker ___ ___ Python-

[issue6281] Bug in hashlib

2009-06-13 Thread Daniel Eloff
New submission from Daniel Eloff : The try statement at the end of hashlib.py is some of the worst python code I've had the mispleasure of reading for a long time. Secondly, it seems flawed in function as well as form. __get_builtin_constructor can throw an ImportError, which seems erroneously c