[Python-Dev] Failures in test_site.py - how to debug?

Random832 random832 at fastmail.com
Fri Aug 19 10:31:35 EDT 2016


On Fri, Aug 19, 2016, at 10:13, Chris Angelico wrote:
> On my main dev system (Debian Stretch), I've had a single
> long-standing test failure - test_site.py,
> StartupImportTests.test_startup_imports. It's annoying (partly because
> it's such a noisy failure), and doesn't appear to be happening on the
> buildbots, nor presumably on core devs' computers, so it's probably
> not a Python bug. How can I go about figuring out what's actually
> going on here?
> 
> The test effectively runs this (but with -v, which makes it noisy):

the -v output might be helpful in determining what is causing these
modules to be imported. It would at least show what order they're
imported in.

FWIW, the list of modules that yours has that are not present in my
3.5.2:
- _bootlocale _collections _functools _heapq _locale _operator
- collections collections.abc functools heapq itertools keyword
- mpl_toolkits operator reprlib types weakref

Modules that mine has imported but yours does not:
- _sysconfigdata sitecustomize

> It then runs into a failure when it asserts that this set has no
> intersection with the set of collection_mods. Apparently 'import sys'
> on my system (even with -I for isolation mode) loads up a bunch of
> modules that it shouldn't be loading.

I very much doubt that "import sys" is responsible here.

> How do I track down what and
> why, and figure out whether it's a config problem unique to my system
> or not?


More information about the Python-Dev mailing list