
report at bugs
Jul 17, 2009, 8:36 AM
Post #1 of 5
(264 views)
Permalink
|
|
[issue6504] infinite recursion from calling builtins.open()
|
|
New submission from kai zhu <kaizhu256 [at] gmail>: # copy this to test.py # > touch foo.txt # > python3.1 -c "import test; import collections" # > ... # > File "test.py", line 5, in find_module # > def find_module(self, mname, path = None): open("foo.txt") # > File "test.py", line 5, in find_module # > def find_module(self, mname, path = None): open("foo.txt") # > File "test.py", line 5, in find_module # > def find_module(self, mname, path = None): open("foo.txt") # > File "test.py", line 5, in find_module # > def find_module(self, mname, path = None): open("foo.txt") # > RuntimeError: maximum recursion depth exceeded while calling a # > Python object class importer(object): def find_module(self, mname, path = None): open("foo.txt") import sys; sys.meta_path.append(importer) *** # note recursion behavior stops if we don't call open() class importer(object): def find_module(self, mname, path = None): pass import sys; sys.meta_path.append(importer) ---------- components: IO, Interpreter Core messages: 90627 nosy: kaizhu severity: normal status: open title: infinite recursion from calling builtins.open() type: behavior versions: Python 3.1 _______________________________________ Python tracker <report [at] bugs> <http://bugs.python.org/issue6504> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|