[issue6526] importlib.import_module affects permissions of .pyc files subsequently created by import

Brett Cannon report at bugs.python.org
Tue Jul 21 01:28:24 CEST 2009


Brett Cannon <brett at python.org> added the comment:

On Mon, Jul 20, 2009 at 16:25, R. David Murray <report at bugs.python.org>wrote:

>
> R. David Murray <rdmurray at bitdance.com> added the comment:
>
> Oh, a bit of clarification: the call that creates the pyc file in both
> the "normal" case and the error case is a call to the normal import
> command (or __import__ in the test case). The call to import_module is a
> prereq to producing the bug, but it doesn't matter what module it
> imports (as long as it hasn't been previously imported).  The import
> that shows the behavior imports a TESTFN module in the test case.
>
> You might want to load up the test case and play with it.  I'm
> completely mystified as to how import_module could be affecting the
> regular import semantics...I'm guessing it is a subtle side effect of
> something unexpected ;)

It's beyond mystifying as both importlib.__import__ and
importlib.import_module are thin wrappers that do nothing but splice strings
for the same function that does the heavy lifting. But I will see if I ever
find time to work on this.

----------
Added file: http://bugs.python.org/file14527/unnamed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6526>
_______________________________________
-------------- next part --------------
<br><br><div class="gmail_quote">On Mon, Jul 20, 2009 at 16:25, R. David Murray <span dir="ltr">&lt;<a href="mailto:report at bugs.python.org">report at bugs.python.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
R. David Murray &lt;<a href="mailto:rdmurray at bitdance.com">rdmurray at bitdance.com</a>&gt; added the comment:<br>
<br>
Oh, a bit of clarification: the call that creates the pyc file in both<br>
the &quot;normal&quot; case and the error case is a call to the normal import<br>
command (or __import__ in the test case). The call to import_module is a<br>
prereq to producing the bug, but it doesn&#39;t matter what module it<br>
imports (as long as it hasn&#39;t been previously imported).  The import<br>
that shows the behavior imports a TESTFN module in the test case.<br>
<br>
You might want to load up the test case and play with it.  I&#39;m<br>
completely mystified as to how import_module could be affecting the<br>
regular import semantics...I&#39;m guessing it is a subtle side effect of<br>
something unexpected ;)</blockquote><div><br></div><div>It&#39;s beyond mystifying as both importlib.__import__ and importlib.import_module are thin wrappers that do nothing but splice strings for the same function that does the heavy lifting. But I will see if I ever find time to work on this. </div>

</div>


More information about the Python-bugs-list mailing list