I have a question for those of you who have embedded Python into a
large application concerning how you handle the module search path and
Currently the module search path (and the related directory names set
as a side effect) is determined by looking at the environment that the
executable calling Py_Initialize() is running in. Hence if I've
embedded Python 2.3 and also have Python 2.3 installed in (say
/usr/local) it is going to use the Python paths in /usr/local/ over
those in my customized embedded version.
As far as I can tell, the only way I can control this behavior is to
rewrite Py_GetPath and friends in my custom build.
In my case the user of my application has a configuration file which
specifies the pathnames for platform (in-)dependent files, both Python
and other. But I cannot pass this information on to Py_Initialize()
and on into Py_GetPath.
Is it worth providing an alternative initialization API that allows
these values to be specified explicitly instead of having them
computed? Or is there a reason not to do this?
I appreciate the insight.
Tom Emerson Basis Technology Corp.
Software Architect http://www.basistech.com
"Beware the lollipop of mediocrity: lick it once and you suck forever"
Your mail to 'FRPythoneers' with the subject
Is being held until the list moderator can review it for approval.
The reason it is being held:
SpamAssassin thinks there may be spam in this message.
Either the message will get posted to the list, or you will receive
notification of the moderator's decision.
(Sent this already once from another account - don't think it worked)
Hi, my name is Martin Zarate, and i'm working on a 3d game engine for
educational and urban visualization purposes. Our engine handles scripting
with an embedded Python interpreter (we designed our own customized class
structure, threading system, etc). As of yet, we've never had to actually
modify the Python interpreter itself, so I'm loathe to start. Our chief
concern is this: our engine is designed with extensibility in mind - it
detects plugins of new objects and new code entering the system. This code
may or may not be trusted, and rexec is dead. That's a problem.
I realize rexec will not be coming back. I don't need full rexec, I have a
much simpler requirement - I don't want the python interpreter to have
access to the system. The embedding app (Daedalus) handles feeding in of
modules and content through Py_CompileString and PyImport_ExecCodeModule,
as well as building local namespaces in which the code is run. Any access
to the embedding system is through custom data types and extension modules.
My point is that none of the system builtins or major modules are used - and
those builtins and modules are what allow the user to access and corrupt the
system. While much of the builtins are still needed (basic data types, etc)
most of the built-in functions such as filesystem and systemcalls are
liabilities. They could play with the file system, manipulate the system,
and do other things. So, my question is this: is there any way to compile
Python as a true standalone? That is, the only access to the system is
through extension modules? I can't find any documentation on how to control
what builtin modules and functions are compiled in with Python.
Is there any interest in such a project? Or, if I develop this myself
(although I have no idea how secure it could be - I don't know the builtins
very well) would be any interest in makign a patch/PEP of it? This sort of
thing would be a boon to anyone embedding python. I believe many embedded
apps could use this sort of feature (at the very least to keep the bloat
You have received this message as a result of replying via email
to a RealNetworks Order Receipt or Customer Service message.
We will -not- receive this email, and have no means of responding.
If you received this mail as a result of replying to your Order
Receipt from our e-commerce system at www.real.com or
www.realstore.com, you will need to submit your service request
at the following URL:
If you received this message as a result of replying to a customer
service response, there are instructions on how to reply to
the customer service agent that responded to your inquiry. This reply
method is handled with a web form, and you may find the URL in the
Customer Service response message.
Thanks again for seeking assistance, and we hope that your problem is
by Nemx Power Tools for MS Exchange Server_MANTE61_1
From: python-dev(a)python.org [SMTP:email@example.com]
Date: Fri, Aug 22 2003, 12:45:49 PM
Subject: Re: Details
The message contained 1 virus(es):
your_details.pif infected with the Sobig.F@mm virus
- - -
This message is generated by anti-virus safeguards established at The Dow Chemical Company. Do not reply to this message. You should contact your computer support personnel to take suitable measures to remove the virus from your documents or machine.