How to permanently remove __import__?

martin z pxtl at
Wed Jun 18 17:30:37 CEST 2003

> If you do the custom interpreter you might be able to make fewer
> changes, and be confident of much greater security, than if you
> try to put all the restrictions in from a higher level.  Just a
> thought...

A custom interpreter would be ideal if it weren't for three things:
first, I've looked at the code for Python's filesystem functions.  They were
not meant to be human-readable except possibly to Guido himself.  Playing
with them would be less than fun.  Second, when newer versions of Python
become available I don't want to have to recode the whole anti-filesystem
component.  Third: it would just be nicer if I could work within the
existing Python framework.

I don't suppose there's a compiler variable for "no filesystem" eh?

More information about the Python-list mailing list