Discussion:
[Bitpim-devel] Occasional load failure in pycrypto
Roger Binns
2004-09-05 23:03:42 UTC
Permalink
I think I have finally got to the bottom of all this. It is
an interaction between various components. Mike, you can get
up and running merely by doing `apt-get install libgmp3'

The pycrypto module includes a binary module named _fastmath
which is in a file named _fastmath.so. This is used to speedup
some RSA stuff amongst other things. It uses the GNU multi-precision
library to accomplish this (libgmp).

Consequently the binary module ends up dynamically linked against
/usr/lib/libgmp3.so (or equivalent).

In an ordinary Python interpretter, trying to load _fastmath when
libgmp3 is not present results in an import error. pycrypto silently
falls back onto pure Python code.

When the program is wrapped for binary distribution using cx-freeze,
the stub in cx-freeze treats the module as loaded, but it isn't if
libgmp3 isn't present. The 'symbol' error (or any other for that
matter) can't be found in the half loaded module.

I'll take this up with the cx-Freeze folks who are doing a new
release any day now anyway.

Roger

Loading...