This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix for major rexec bugs
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: niemeyer Nosy List: loewis, niemeyer
Priority: release blocker Keywords: patch

Created on 2002-11-11 21:51 by niemeyer, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
rexec.patch niemeyer, 2002-11-11 21:51 Revision 1
Messages (3)
msg41625 - (view) Author: Gustavo Niemeyer (niemeyer) * (Python committer) Date: 2002-11-11 21:51
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.
msg41626 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-11-14 07:57
Logged In: YES 
user_id=21627

The patch looks fine, please apply it.
msg41627 - (view) Author: Gustavo Niemeyer (niemeyer) * (Python committer) Date: 2002-12-16 13:13
Logged In: YES 
user_id=7887

Applied as

Lib/rexec.py: 1.46
Lib/ihooks.py: 1.15
Misc/NEWS: 1.560

Thanks for reviewing Martin!
History
Date User Action Args
2022-04-10 16:05:53adminsetgithub: 37456
2002-11-11 21:51:17niemeyercreate