[issue9250] sys.modules changes size during iteration in regrtest module

R. David Murray report at bugs.python.org
Tue Jul 13 23:26:05 CEST 2010

R. David Murray <rdmurray at bitdance.com> added the comment:

Autotest runs the Python regression suite, it just does it a different way.  And it still works on trunk. Since it isn't documented (I wasn't even aware it existed), maybe we should just delete it. :)

Note that I'm not saying there's no bug here.  But importing regrtest in the general case is not supported by the core team, so we may well break that usage for any number of good reasons.  In this case, it was to support changing the CWD when running tests to facilitate test cleanup.  The loop expects a limited number of modules to be in sys.modules when it runs (it is fixing a test-only startup issue with __file__ in early-imported modules when run from Lib).

Note that the change that triggered the error you are seeing was made relatively recently (it worked before I updated and failed afterward, and my checkout was fairly up to date).  There were no regrtest changes, but there were distutils changes (utils and sysconfig were the modules I noticed getting updated).

I'm adding ezio and flox to nosy since I believe they added the regrtest loop in question, but I think we will probably close this won't fix.

nosy: +ezio.melotti, flox -brett.cannon
priority: normal -> low
resolution:  -> wont fix
status: open -> pending

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list