Try Python update

Mike Meyer mwm at mired.org
Sun Jan 1 21:30:38 EST 2006


"Devan L" <devlai at gmail.com> writes:
>> > On a side note, my brother has tinkered with the C internals and now
>> > __subclasses__ is restricted and many, many os and posix commands are
>> > restricted (not that you can get them anyways, since importing is
>> > broken!)
>> I got import to work by pickling pairs of names - the variable name
>> that references the module, and the name of the module. When it
>> unpickles the list, it reimports them and points the appropriate
>> variable at them. This had unwanted effects if you did an "import
>> this". It also doesn't work for objects that contain references to
>> modules.
> My general method of storing is to store everything possible. See a
> function? Store the function object itself. See a class? Store the
> class object. Unfortunately, I can't store builtin methods or
> functions, so this breaks on most modules. Don't try to reference the
> __builtins__, by the way, otherwise it won't be removed and modjelly
> will break.

I think the idea I used for modules would generalize: If you can't
store it, store the information you need to relocate it, and recreate
the binding.

>> I tried for a bit to restrict things, then gave up and did it
>> externally. There's no access to any files but those required to run
>> the script that deals with thing, and some other python modules that I
>> decided would be nice to have. Normally, nothing in the tree is
>> writable, either. Once I'm happy with it, I'll save a copy of the tree
>> somewhere and set up a cron job to "refresh" it at regular intervals.
> I don't have enough control on the server to effectively restrict it
> externally (no running as an unprivelleged user!), so I have to lock it
> down as tightly as possible internally.

My ISP provides this facility. They provided a less strict version,
and worked with me to create this facility. While they aren't perfect,
I can't say enough good things about them. If you need internet
connectivity, web hosting, whatever - idiom.com is good people to work
with.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list