Author Jurko.Gospodnetić
Recipients Jurko.Gospodnetić
Date 2014-03-10.16:13:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Python 3.4 introduced a change to Lib/importlib/ that added the following code to it:

> else:
>     # importlib._bootstrap is the built-in import, ensure we don't create
>     # a second copy of the module.
>     _bootstrap.__name__ = 'importlib._bootstrap'
>     _bootstrap.__package__ = 'importlib'
>     _bootstrap.__file__ = __file__.replace('', '')
>     sys.modules['importlib._bootstrap'] = _bootstrap

When attempting to use cxFreeze on a project, using Python 3.4. we ran into a problem with '__file__' identifier not being defined.

I believe this is a bug since the code expects the module loaded from importlib/ to always have a __file__ identifier set.

Python 3.4.0rc3 documentation explicitly states:

> __file__ is optional. If set, this attribute’s value must be a
> string. The import system may opt to leave __file__ unset if it
> has no semantic meaning (e.g. a module loaded from a database).


> Ultimately, the loader is what makes use of __file__ and/or
> __cached__.

A possible fix would be to skip setting the _bootstrap.__file__ attribute if the current module does not have a __file__ attribute set.

I hope this can be resolved before the 3.4 final release or it will not be possible to use cxFreeze with Python 3.4 without additional workarounds in cxFreeze.

Best regards,
  Jurko Gospodnetić
Date User Action Args
2014-03-10 16:13:50Jurko.Gospodnetićsetrecipients: + Jurko.Gospodnetić
2014-03-10 16:13:50Jurko.Gospodnetićsetmessageid: <>
2014-03-10 16:13:50Jurko.Gospodnetićlinkissue20884 messages
2014-03-10 16:13:49Jurko.Gospodnetićcreate