[issue6504] infinite recursion from calling builtins.open()

kai zhu report at bugs.python.org
Sat Jul 18 12:48:21 CEST 2009


kai zhu <kaizhu256 at gmail.com> added the comment:

current hack-around, then is to pre-import locale, which is verified to 
work:

# beg test.py
class importer(object):
  def find_module(self, mname, path = None): open("foo.txt")
import sys, locale; sys.meta_path.append(importer)
import collections # no recursion
# end test.py

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6504>
_______________________________________


More information about the Python-bugs-list mailing list