Re: Using marshal to manually "import" a python module



The strange thing is, it worked fine locally on my two machines (32bit
running python 2.3.5 and 64bit running python 2.4.1), but when run by a
64bit machine on the network, it would fail every time in the following
manner:

It may not that much be an issue of 32-bit vs. 64-bit, but of Python 2.3
vs. Python 2.4. The marshal format changes across versions, and files
created in one version might not be understood correctly by another version.

Now, you don't give enough details on resolving this completely: what
specific microprocessors, and what specific operating systems are you
using? What is the specific code of the module that fails to load (e.g.
minimal example), and what is the resulting byte code?

Off-hand, I can't see why a 2.3-generated file shouldn't be loadable
by a 2.4 interpreter, but you say "it" fails without saying what "it"
is (i.e. running the 64-bit machine to generate a marshal file over
the net that is then read by the 32-bit machine, or vice versa).

I can't figure out why this would work locally, but not when the module
is loaded across a network. In fact, I have no idea what would ever
cause it not to see A as a function. I'm stumped, and this is over my
head as far as intimate knowledge of the direct loading of python
bytecode via marshal is concerned...so I'm not clear on the best way to
debug it.

I would trace through the loading, either in a debugger, or by adding
printf statements into marshal.

Regards,
Martin
.



Relevant Pages

  • Re: ANN: Kamaelia 0.2.0 released!
    ... you can build network servers and new protocols relatively simply ... * Decent GUI integration yet. ... As the original announcement said "Kamaelia is designed as ... Components are object instances of python classes. ...
    (comp.lang.python)
  • Re: [ANNOUNCE] Python network security tools: Pcapy, Impacket, InlineEgg
    ... The Pcapy Win32 binaries doesn't contain a setup.py file. ... >Python developers, network administrators, penetration testers, ... >Python to access the routines from the pcap packet capture library. ... >low–level network monitoring. ...
    (comp.lang.python)
  • [ANN] netaddr for Python
    ... It is a network address manipulation library released ... NetAddr is now in beta and is currently ... Developers and testers are needed to assist in ... Python which is distinctly lacking when compared with other popular ...
    (comp.lang.python.announce)
  • Distributed computation of jobs (was: Parallel Python)
    ... About three years ago, I wrote two Python modules, one called 'exec_proxy', ... providing ligh-weight transparent access to a machine across a network. ... The idea behind this module was/is that by just using ssh you have network ... The more interesting Python module called 'batchlib' lies on top of the former ...
    (comp.lang.python)
  • Re: Does Python really follow its philosophy of "Readability counts"?
    ... what's interface and what's implementation, ... (snip convoluted counter-example) ... can't fail, and considers failure modes to be bugs to be fixed. ... the parts written in Python are built to a much lower standard. ...
    (comp.lang.python)