Currently pkgutil cannot be imported unless you first import importlib.machinery. This means ./python.exe -m pkgutil works, but doing ``import pkgutil`` in the REPL does not.
I'm seeing the same symptom locally. If you use -m to execute things, the problem isn't noticeable because runpy imports importlib.machinery. It looks like test.regrtest imports it as well: $ ./python -m test test_pkgutil [1/1] test_pkgutil 1 test OK. $ ./python Lib/test/regrtest.py test_pkgutil [1/1] test_pkgutil 1 test OK. $ ./python Lib/test/test_pkgutil.py Traceback (most recent call last): File "Lib/test/test_pkgutil.py", line 5, in import pkgutil File "/home/ncoghlan/devel/py3k/Lib/pkgutil.py", line 161, in importlib.machinery.FileFinder, _iter_file_finder_modules) AttributeError: 'module' object has no attribute 'machinery'
Ah, I figured out which commit broke it, too: the one that deprecated the imp module (see http://hg.python.org/cpython/rev/1b8f08c4efd5) Previously, the importlib.machinery dependency was satisfied indirectly through imp.