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

Chris Angelico rosuav at gmail.com
Fri Aug 19 12:02:00 EDT 2016


On Sat, Aug 20, 2016 at 12:31 AM, Random832 <random832 at fastmail.com> wrote:
> 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.

Here it is in all its spammy glory.

rosuav at sikorsky:~/cpython$ ./python -I -v -c 'import sys;
print(set(sys.modules))'
import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
# /home/rosuav/cpython/Lib/encodings/__pycache__/__init__.cpython-36.pyc
matches /home/rosuav/cpython/Lib/encodings/__init__.py
# code object from
'/home/rosuav/cpython/Lib/encodings/__pycache__/__init__.cpython-36.pyc'
# /home/rosuav/cpython/Lib/__pycache__/codecs.cpython-36.pyc matches
/home/rosuav/cpython/Lib/codecs.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/codecs.cpython-36.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object
at 0x7f6d060ccda0>
# /home/rosuav/cpython/Lib/encodings/__pycache__/aliases.cpython-36.pyc
matches /home/rosuav/cpython/Lib/encodings/aliases.py
# code object from
'/home/rosuav/cpython/Lib/encodings/__pycache__/aliases.cpython-36.pyc'
import 'encodings.aliases' #
<_frozen_importlib_external.SourceFileLoader object at 0x7f6d060e1898>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d060cc978>
# /home/rosuav/cpython/Lib/encodings/__pycache__/utf_8.cpython-36.pyc
matches /home/rosuav/cpython/Lib/encodings/utf_8.py
# code object from
'/home/rosuav/cpython/Lib/encodings/__pycache__/utf_8.cpython-36.pyc'
import 'encodings.utf_8' #
<_frozen_importlib_external.SourceFileLoader object at 0x7f6d060f0710>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# /home/rosuav/cpython/Lib/encodings/__pycache__/latin_1.cpython-36.pyc
matches /home/rosuav/cpython/Lib/encodings/latin_1.py
# code object from
'/home/rosuav/cpython/Lib/encodings/__pycache__/latin_1.cpython-36.pyc'
import 'encodings.latin_1' #
<_frozen_importlib_external.SourceFileLoader object at 0x7f6d060f4278>
# /home/rosuav/cpython/Lib/__pycache__/io.cpython-36.pyc matches
/home/rosuav/cpython/Lib/io.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/io.cpython-36.pyc'
# /home/rosuav/cpython/Lib/__pycache__/abc.cpython-36.pyc matches
/home/rosuav/cpython/Lib/abc.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/abc.cpython-36.pyc'
# /home/rosuav/cpython/Lib/__pycache__/_weakrefset.cpython-36.pyc
matches /home/rosuav/cpython/Lib/_weakrefset.py
# code object from
'/home/rosuav/cpython/Lib/__pycache__/_weakrefset.cpython-36.pyc'
import '_weakrefset' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d060f90f0>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at
0x7f6d060f47f0>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at
0x7f6d060f44a8>
# /home/rosuav/cpython/Lib/__pycache__/site.cpython-36.pyc matches
/home/rosuav/cpython/Lib/site.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/site.cpython-36.pyc'
# /home/rosuav/cpython/Lib/__pycache__/os.cpython-36.pyc matches
/home/rosuav/cpython/Lib/os.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/os.cpython-36.pyc'
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
# /home/rosuav/cpython/Lib/__pycache__/stat.cpython-36.pyc matches
/home/rosuav/cpython/Lib/stat.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/stat.cpython-36.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at
0x7f6d060a1940>
# /home/rosuav/cpython/Lib/__pycache__/posixpath.cpython-36.pyc
matches /home/rosuav/cpython/Lib/posixpath.py
# code object from
'/home/rosuav/cpython/Lib/__pycache__/posixpath.cpython-36.pyc'
# /home/rosuav/cpython/Lib/__pycache__/genericpath.cpython-36.pyc
matches /home/rosuav/cpython/Lib/genericpath.py
# code object from
'/home/rosuav/cpython/Lib/__pycache__/genericpath.cpython-36.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d060ab2e8>
import 'posixpath' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d060a1fd0>
# /home/rosuav/cpython/Lib/__pycache__/_collections_abc.cpython-36.pyc
matches /home/rosuav/cpython/Lib/_collections_abc.py
# code object from
'/home/rosuav/cpython/Lib/__pycache__/_collections_abc.cpython-36.pyc'
import '_collections_abc' #
<_frozen_importlib_external.SourceFileLoader object at 0x7f6d060ab8d0>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at
0x7f6d0608cf98>
# /home/rosuav/cpython/Lib/__pycache__/_sitebuiltins.cpython-36.pyc
matches /home/rosuav/cpython/Lib/_sitebuiltins.py
# code object from
'/home/rosuav/cpython/Lib/__pycache__/_sitebuiltins.cpython-36.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d060912b0>
# /home/rosuav/cpython/Lib/__pycache__/sysconfig.cpython-36.pyc
matches /home/rosuav/cpython/Lib/sysconfig.py
# code object from
'/home/rosuav/cpython/Lib/__pycache__/sysconfig.cpython-36.pyc'
import 'sysconfig' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d06073240>
# /home/rosuav/cpython/build/lib.linux-x86_64-3.6/__pycache__/_sysconfigdata_m.cpython-36.pyc
matches /home/rosuav/cpython/build/lib.linux-x86_64-3.6/_sysconfigdata_m.py
# code object from
'/home/rosuav/cpython/build/lib.linux-x86_64-3.6/__pycache__/_sysconfigdata_m.cpython-36.pyc'
import '_sysconfigdata_m' #
<_frozen_importlib_external.SourceFileLoader object at 0x7f6d0607ac88>
# /home/rosuav/cpython/Lib/__pycache__/_bootlocale.cpython-36.pyc
matches /home/rosuav/cpython/Lib/_bootlocale.py
# code object from
'/home/rosuav/cpython/Lib/__pycache__/_bootlocale.cpython-36.pyc'
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d06082fd0>
# /home/rosuav/cpython/Lib/__pycache__/types.cpython-36.pyc matches
/home/rosuav/cpython/Lib/types.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/types.cpython-36.pyc'
# /home/rosuav/cpython/Lib/__pycache__/functools.cpython-36.pyc
matches /home/rosuav/cpython/Lib/functools.py
# code object from
'/home/rosuav/cpython/Lib/__pycache__/functools.cpython-36.pyc'
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
# /home/rosuav/cpython/Lib/collections/__pycache__/__init__.cpython-36.pyc
matches /home/rosuav/cpython/Lib/collections/__init__.py
# code object from
'/home/rosuav/cpython/Lib/collections/__pycache__/__init__.cpython-36.pyc'
# /home/rosuav/cpython/Lib/__pycache__/operator.cpython-36.pyc matches
/home/rosuav/cpython/Lib/operator.py
# code object from
'/home/rosuav/cpython/Lib/__pycache__/operator.cpython-36.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d06041c50>
# /home/rosuav/cpython/Lib/__pycache__/keyword.cpython-36.pyc matches
/home/rosuav/cpython/Lib/keyword.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/keyword.cpython-36.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object
at 0x7f6d0604bfd0>
# /home/rosuav/cpython/Lib/__pycache__/heapq.cpython-36.pyc matches
/home/rosuav/cpython/Lib/heapq.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/heapq.cpython-36.pyc'
# extension module '_heapq' loaded from
'/home/rosuav/cpython/build/lib.linux-x86_64-3.6/_heapq.cpython-36m-x86_64-linux-gnu.so'
# extension module '_heapq' executed from
'/home/rosuav/cpython/build/lib.linux-x86_64-3.6/_heapq.cpython-36m-x86_64-linux-gnu.so'
import '_heapq' # <_frozen_importlib_external.ExtensionFileLoader
object at 0x7f6d043d3d68>
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object
at 0x7f6d043d3898>
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# /home/rosuav/cpython/Lib/__pycache__/reprlib.cpython-36.pyc matches
/home/rosuav/cpython/Lib/reprlib.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/reprlib.cpython-36.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object
at 0x7f6d0604b908>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d060242b0>
# /home/rosuav/cpython/Lib/__pycache__/weakref.cpython-36.pyc matches
/home/rosuav/cpython/Lib/weakref.py
# code object from '/home/rosuav/cpython/Lib/__pycache__/weakref.cpython-36.pyc'
import 'weakref' # <_frozen_importlib_external.SourceFileLoader object
at 0x7f6d06024630>
import 'functools' # <_frozen_importlib_external.SourceFileLoader
object at 0x7f6d06017ba8>
# /home/rosuav/cpython/Lib/collections/__pycache__/abc.cpython-36.pyc
matches /home/rosuav/cpython/Lib/collections/abc.py
# code object from
'/home/rosuav/cpython/Lib/collections/__pycache__/abc.cpython-36.pyc'
import 'collections.abc' #
<_frozen_importlib_external.SourceFileLoader object at 0x7f6d06019898>
import 'types' # <_frozen_importlib_external.SourceFileLoader object
at 0x7f6d0600ffd0>
import 'site' # <_frozen_importlib_external.SourceFileLoader object at
0x7f6d06102a90>
Python 3.6.0a4+ (default:4b64a049f451+, Aug 19 2016, 23:41:43)
[GCC 6.1.1 20160802] on linux
Type "help", "copyright", "credits" or "license" for more information.
{'collections', 'io', 'encodings', '_io', 'marshal', 'weakref',
'genericpath', 'os', '_imp', 'codecs', '_weakrefset', '_locale',
'keyword', '__main__', 'stat', '_sitebuiltins', 'collections.abc',
'site', 'posix', 'encodings.aliases', 'errno', '_weakref',
'_collections_abc', 'os.path', '_collections', '_heapq', 'reprlib',
'_warnings', '_frozen_importlib', 'heapq', '_stat',
'encodings.latin_1', '_operator', '_sysconfigdata_m', 'types',
'zipimport', 'posixpath', 'builtins', '_thread', 'sysconfig',
'encodings.utf_8', 'mpl_toolkits', '_functools', 'itertools',
'_codecs', 'abc', 'operator', 'functools', 'sys', '_bootlocale',
'_signal', '_frozen_importlib_external'}
# clear builtins._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.__interactivehook__
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup[2] removing collections
# cleanup[2] removing io
# destroy io
# cleanup[2] removing _collections
# cleanup[2] removing sysconfig
# destroy sysconfig
# cleanup[2] removing _heapq
# cleanup[2] removing encodings
# destroy encodings
# cleanup[2] removing _io
# cleanup[2] removing marshal
# cleanup[2] removing encodings.latin_1
# cleanup[2] removing _warnings
# cleanup[2] removing _operator
# cleanup[2] removing _frozen_importlib
# cleanup[2] removing genericpath
# cleanup[2] removing heapq
# cleanup[2] removing os
# cleanup[2] removing _imp
# cleanup[2] removing itertools
# cleanup[2] removing codecs
# cleanup[2] removing _sysconfigdata_m
# destroy _sysconfigdata_m
# cleanup[2] removing _weakrefset
# destroy _weakrefset
# cleanup[2] removing types
# destroy types
# cleanup[2] removing zipimport
# cleanup[2] removing posixpath
# cleanup[2] removing _locale
# cleanup[2] removing builtins
# cleanup[2] removing keyword
# destroy keyword
# cleanup[2] removing encodings.utf_8
# cleanup[2] removing mpl_toolkits
# destroy mpl_toolkits
# cleanup[2] removing __main__
# destroy __main__
# cleanup[2] removing _functools
# cleanup[2] removing _sitebuiltins
# cleanup[2] removing collections.abc
# cleanup[2] removing _thread
# cleanup[2] removing site
# destroy site
# cleanup[2] removing reprlib
# destroy reprlib
# cleanup[2] removing posix
# cleanup[2] removing _codecs
# cleanup[2] removing stat
# cleanup[2] removing abc
# cleanup[2] removing encodings.aliases
# cleanup[2] removing errno
# cleanup[2] removing _stat
# cleanup[2] removing _weakref
# cleanup[2] removing operator
# destroy operator
# cleanup[2] removing functools
# cleanup[2] removing _collections_abc
# cleanup[2] removing _bootlocale
# destroy _bootlocale
# cleanup[2] removing _signal
# cleanup[2] removing _frozen_importlib_external
# cleanup[2] removing sys
# cleanup[2] removing os.path
# cleanup[2] removing weakref
# destroy weakref
# destroy zipimport
# destroy _signal
# destroy _sitebuiltins
# destroy errno
# destroy posixpath
# destroy abc
# destroy _stat
# destroy genericpath
# destroy stat
# destroy os
# destroy _locale
# destroy functools
# destroy _functools
# destroy heapq
# destroy collections.abc
# destroy _collections_abc
# destroy _operator
# destroy _heapq
# destroy _collections
# destroy collections
# destroy itertools
# cleanup[3] wiping _io
# cleanup[3] wiping marshal
# cleanup[3] wiping encodings.latin_1
# cleanup[3] wiping _warnings
# cleanup[3] wiping _frozen_importlib
# destroy _frozen_importlib_external
# cleanup[3] wiping _imp
# cleanup[3] wiping codecs
# cleanup[3] wiping encodings.utf_8
# cleanup[3] wiping _thread
# cleanup[3] wiping posix
# cleanup[3] wiping _codecs
# cleanup[3] wiping encodings.aliases
# cleanup[3] wiping _weakref
# cleanup[3] wiping sys
# cleanup[3] wiping builtins
rosuav at sikorsky:~/cpython$


ChrisA


More information about the Python-Dev mailing list