<p dir="ltr"><br>
On 10 Mar 2014 19:15, "Jurko Gospodnetić" <<a href="mailto:jurko.gospodnetic@pke.hr">jurko.gospodnetic@pke.hr</a>> wrote:<br>
><br>
> Hi all.<br>
><br>
> Python 3.4 introduced a change to Lib/importlib/__init__.py that added the following code to it:<br>
><br>
>> else:<br>
>> # importlib._bootstrap is the built-in import, ensure we don't create<br>
>> # a second copy of the module.<br>
>> _bootstrap.__name__ = 'importlib._bootstrap'<br>
>> _bootstrap.__package__ = 'importlib'<br>
>> _bootstrap.__file__ = __file__.replace('__init__.py', '_bootstrap.py')<br>
>> sys.modules['importlib._bootstrap'] = _bootstrap<br>
><br>
><br>
> When attempting to use cxFreeze on a project, using Python 3.4. we ran into a problem with '__file__' identifier not being defined.<br>
><br>
> Could this be a python bug? Why is this code expecting the module loaded from importlib/__init__.py to always have a __file__ identifier? What is supposed to happen when that code gets loaded from a ZIP archive?</p>
<p dir="ltr">__file__ is expected to always be set (including when loaded from a zipfile - in that case it's the zipfile name concatenated with the path within the zip file). If it isn't set, there's a buggy loader involved somewhere that isn't setting it properly.</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> Just wanted to check here before filing an issue... but if this is an issue I hope it can be resolved before the final 3.4 release.<br>
><br>
> Best regards,<br>
> Jurko Gospodnetić<br>
><br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>