<div dir="ltr">2013/8/2 Maciej (Matchek) Bliziński <span dir="ltr"><<a href="mailto:maciej@opencsw.org" target="_blank">maciej@opencsw.org</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="im">>> There is a mechanism, but the user has no write permissions to the<br>
>> directories where the modules are.<br>
><br>
> I mean in his home directory, ${TMPDIR}, &c.<br>
<br>
</div>I would doubt it works in a general case, e.g. you can't assume that<br>
there is a home directory, and I'm pretty sure Python wouldn't save<br>
bytecode into /tmp.<br></blockquote><div><br></div><div></div></div>That's right, a little test show that in only tries the __pycache__ directory:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">

$ truss -f python3 test.py  2>&1 | egrep "copy.*pyc"</div><div class="gmail_extra">1395:   open64("/opt/csw/lib/python3.3/__pycache__/copyreg.cpython-33.pyc", O_RDONLY) Err#2 ENOENT</div><div class="gmail_extra">

1395:   open64("/opt/csw/lib/python3.3/__pycache__/copyreg.cpython-33.pyc.4274440288", O_WRONLY|O_CREAT|O_EXCL, 0644) Err#13 EACCES [ALL]</div><div class="gmail_extra">1395:   open64("/opt/csw/lib/python3.3/__pycache__/copy.cpython-33.pyc", O_RDONLY) Err#2 ENOENT</div>

<div class="gmail_extra">1395:   open64("/opt/csw/lib/python3.3/__pycache__/copy.cpython-33.pyc.4271408496", O_WRONLY|O_CREAT|O_EXCL, 0644) Err#13 EACCES [ALL]</div><div><br></div></div><div class="gmail_extra">

and the following document which describes how __pycache__ works doesn't talk about a user writeable directory possibility: <a href="http://www.python.org/dev/peps/pep-3147/">http://www.python.org/dev/peps/pep-3147/</a></div>

<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>Yann</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>