Replacing open builtin

rmm at iname.com rmm at iname.com
Wed May 11 08:20:28 EDT 2005


If I replace the open builtin eg

import main
__main__.__builtins__.open=None

Is there any way, from here on, to access the original open function??

Extending this slightly, lets say I put a reference to the original
open function inside a class called Isolate and protect this reference
using __getattribute__ and __setattr__.  Is the original function now
isolated and only able to be referenced within Isolate.

In summary, are there any references to builtin functions others than
through __builtins__ and is __getattribute__, __setattr__ secure

Regards

RMM




More information about the Python-list mailing list