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

2010-11-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed in r86395 (3.x); I've only backported the tests to 2.7 and 3.1. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

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

2010-11-11 Thread STINNER Victor
STINNER Victor added the comment: > Here is a patch. It moves warnings initialization after > io initialization (the latter being arguably more critical > than the former). Also adds two tests. initstdio() and initmain() may emit warnings. Eg. issue #8766 (which now have a test in test_warni

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

2010-11-09 Thread STINNER Victor
STINNER Victor added the comment: Oh, I also wrote a patch for the warnings error silently ignored: import_warnings_error.patch. -- Added file: http://bugs.python.org/file19561/import_warnings_error.patch ___ Python tracker

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

2010-11-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. It moves warnings initialization after io initialization (the latter being arguably more critical than the former). Also adds two tests. -- assignee: haypo -> keywords: +patch stage: needs patch -> patch review versions: +Python 2.7,

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

2010-11-09 Thread Antoine Pitrou
Antoine Pitrou 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

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

2010-11-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Weirdly, this patch fixes the issue, but I'm unable to say why: diff -r cd1de1ff2657 Lib/tokenize.py --- a/Lib/tokenize.py Tue Nov 09 02:08:59 2010 +0100 +++ b/Lib/tokenize.py Tue Nov 09 17:16:21 2010 +0100 @@ -24,12 +24,12 @@ __author__ = 'Ka-Ping Yee _

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

2010-11-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: For some reason, this starts happening with the Lib/tokenize.py change in r86346. Resource warnings don't get enabled by -Wd: With r86345: $ ./python -Wd -c "open('LICENSE')" -c:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='LICENSE' encoding='UTF