Issue 636769: Fix for major rexec bugs (original) (raw)
This patch fixes many flavours of the same major problem:
class S(str): def eq(self, obj): return 1
file("/tmp/foo", S("w")) <open file '/tmp/foo', mode 'w' at 0x101fdd88>
import(S("dl")) <module 'dl' from '/usr/lib/python2.2/lib-dynload/dl.so'>
import os os.name = S("dl") reload(os) <module 'dl' from '/usr/lib/python2.2/lib-dynload/dl.so'>
Additionally, it removes the self.f reference of "FileWrapper", includes 'xreadlines' and 'iter' in FileBase.ok_file_methods, and includes 'xreadlines' and '_weakref' in RExec.ok_builtin_modules.