Intra-package C extensions with freeze.py

P

Pascal Chambon

Hello everyone
Some times ago, I've had unexpected problems while trying to freeze some
scripts into a standalone executable with the "freeze.py" script.
I had already done it : normally, you simply freeze pure python modules
into a standalone executable, you package it along with python
extensions (_ssl.so, time.so etc.), and you're done.

But the problem is that I had a dependency with python-fuse bindings,
and these bindings contains a python extension (_fusemodule.so) inside
the "fuseparts" package.
So pure python modules of this fuse wrapper got frozen into the
standalone executable, and I had that "fuseparts/_fusemodule.so" left
outside, which was not found by the module loader, since it was expected
to appear inside a "fuseparts package" now embedded into the executable....

I've managed to solve that by manually "monkey patching" sys.modules,
before fusemodule's actual import. But this looks like an unsatisfying
solution, to me.
Does anyone have a clue about how to freeze a python program cleanly, in
case such inner C extensions are involved ? Does any of the freezers
(freeze.py, py2exe, pyrex, cx_freeze...) do that ? I haven't seen such
things so far in their docs.

Thanks for the attention,
Regards,
Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top