Re: [Python-Dev] hashlib bug when built on OS X 10.6 for 10.5

2010-10-07 Thread Ronald Oussoren

On 6 Oct, 2010, at 22:26, Arnaud Bergeron wrote:

> If you build python (at least 2.6.5, but probably other versions as
> well) in a universal setup using the following command (or similar)
> while the machine currently has 10.6 installed:
> 
> ./configure --with-universal-archs=
> --enable-universalsdk=/Developer/SDKs/MacOSX10.5.sdk/
> 
> then the hashlib module will be unimportable with the following error:
> 
> ImportError: No module named _md5
> 
> This is because the openssl detection code in setup.py picks up the
> system libssl (in /) which is 0.9.8 and selects not to build the
> additional _sha256, and _sh512 modules.  Then, when the builds
> proceeds the SDK libssl is used (in /Developer/SDKs/MacOSX10.5.sdk/)
> which is version 0.9.7 and the openssl_sha256 and openssl_sha512 raise
> ValueError in the _hashlib that is built.

This definitely looks like a bug I fixed before, see 
. The patch should not be present in 2.7 and 
any of the active branches.

I can build hashlib just fine with the HEAD of the release26-maint branch, 
could you please test with 2.6.6?

BTW. In general it is better to file bugs at bugs.python.org instead of mailing 
them here, using the bugtracker ensures that your report doesn't get lost.

Ronald

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] hashlib bug when built on OS X 10.6 for 10.5

2010-10-07 Thread Arnaud Bergeron
If you build python (at least 2.6.5, but probably other versions as
well) in a universal setup using the following command (or similar)
while the machine currently has 10.6 installed:

./configure --with-universal-archs=
--enable-universalsdk=/Developer/SDKs/MacOSX10.5.sdk/

then the hashlib module will be unimportable with the following error:

ImportError: No module named _md5

This is because the openssl detection code in setup.py picks up the
system libssl (in /) which is 0.9.8 and selects not to build the
additional _sha256, and _sh512 modules.  Then, when the builds
proceeds the SDK libssl is used (in /Developer/SDKs/MacOSX10.5.sdk/)
which is version 0.9.7 and the openssl_sha256 and openssl_sha512 raise
ValueError in the _hashlib that is built.

Then the fancy code in hashlib.py detects the ValueError, tries to
import _sha256 and gets an ImportError which is caught by the code set
to catch an ImportError of _hashlib and this codes tries to import
_md5 which also fails and gives the error above.

In summary, the code in setup.py finds the wrong library and this
creates a situation with which hashlib.py is not ready to handle.

If the analysis is not clear on certain points, feel free to ask questions.

Arnaud
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com