[issue10372] [REGRESSION] test_gc fails in non-debug mode.

Antoine Pitrou report at bugs.python.org
Tue Nov 9 17:34:45 CET 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

One observation is that when the -W option is used, the "warnings" module gets loaded very early and itself imports linecache which then imports tokenize. At this point, the standard IO streams have not been initialized (_io is imported later) and the builtin "open" may not exist at all. So when tokenize references "open", it is a NameError at that point (which explains why the "weird fix" above is actually correct).

As an additional annoyance, when importing Lib/warnings.py fails (for example if you sneak in a "1/0" at the beginning of the file), the exception gets silenced: the NameError above doesn't get printed.

----------
nosy: +benjamin.peterson, brett.cannon

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


More information about the Python-bugs-list mailing list