Author adamwill
Recipients adamwill
Date 2016-12-30.02:16:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm not sure if this is really considered a bug or just an unavoidable limitation, but as it involves part of the stdlib operating on Python itself, I figured it was at least worth reporting.

In Fedora we have a fairly simple little script called python-deps:

which is used to figure out the dependencies of a couple of Python scripts used in the installer's initramfs environment, so the necessary bits of Python (but not the rest of it) can be included in the installer's initramfs.

Unfortunately, with Python 3.6, this seems to be broken for the core of Python itself, because of this change:

which changed from doing "from _sysconfigdata import build_time_vars" to using __import__ . I *think* that modulefinder can't cope with this use of __import__ and so misses that sysconfig requires "_sysconfigdata_m_linux_x86_64-linux-gnu" (or whatever the actual name is on your particular platform and arch).

This results in us not including the platform-specific module in the installer initramfs, so Python blows up on startup when the 'site' module tries to import the 'sysconfig' module.

We could work around this one way or another in the python-deps script, but I figured the issue was at least worth an upstream report to see if it's considered a significant issue or not.

You can reproduce the problem quite trivially by writing a test script which just does, e.g., "import site", and then running the example code from the ModuleFinder docs on it:

from modulefinder import ModuleFinder

finder = ModuleFinder()

print('Loaded modules:')
for name, mod in finder.modules.items():
    print('%s: ' % name, end='')

if you examine the output, you'll see that the 'sysconfig' module is included, but the site-specific module is not.
Date User Action Args
2016-12-30 02:16:05adamwillsetrecipients: + adamwill
2016-12-30 02:16:05adamwillsetmessageid: <>
2016-12-30 02:16:05adamwilllinkissue29113 messages
2016-12-30 02:16:03adamwillcreate