[Patches] [ python-Patches-636769 ] Fix for major rexec bugs

noreply@sourceforge.net noreply@sourceforge.net
Wed, 13 Nov 2002 23:57:56 -0800


Patches item #636769, was opened at 2002-11-11 22:51
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=636769&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
>Resolution: Accepted
Priority: 8
Submitted By: Gustavo Niemeyer (niemeyer)
>Assigned to: Gustavo Niemeyer (niemeyer)
Summary: Fix for major rexec bugs

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: Martin v. L÷wis (loewis)
Date: 2002-11-14 08:57

Message:
Logged In: YES 
user_id=21627

The patch looks fine, please apply it.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=636769&group_id=5470