[csw-maintainers] Python 3.x

Peter FELECAN pfelecan at opencsw.org
Fri Aug 2 17:07:59 CEST 2013


Yann Rouillard <yann at pleiades.fr.eu.org> writes:

> 2013/8/2 Maciej (Matchek) Bliziński <maciej at opencsw.org>
>
>> >> There is a mechanism, but the user has no write permissions to the
>> >> directories where the modules are.
>> >
>> > I mean in his home directory, ${TMPDIR}, &c.
>>
>> I would doubt it works in a general case, e.g. you can't assume that
>> there is a home directory, and I'm pretty sure Python wouldn't save
>> bytecode into /tmp.
>>
>
> That's right, a little test show that in only tries the __pycache__
> directory:
>
> $ truss -f python3 test.py  2>&1 | egrep "copy.*pyc"
> 1395:   open64("/opt/csw/lib/python3.3/__pycache__/copyreg.cpython-33.pyc",
> O_RDONLY) Err#2 ENOENT
> 1395:
> open64("/opt/csw/lib/python3.3/__pycache__/copyreg.cpython-33.pyc.4274440288",
> O_WRONLY|O_CREAT|O_EXCL, 0644) Err#13 EACCES [ALL]
> 1395:   open64("/opt/csw/lib/python3.3/__pycache__/copy.cpython-33.pyc",
> O_RDONLY) Err#2 ENOENT
> 1395:
> open64("/opt/csw/lib/python3.3/__pycache__/copy.cpython-33.pyc.4271408496",
> O_WRONLY|O_CREAT|O_EXCL, 0644) Err#13 EACCES [ALL]
>
> and the following document which describes how __pycache__ works doesn't
> talk about a user writeable directory possibility:
> http://www.python.org/dev/peps/pep-3147/

Alright. Just to vent my frustration: this is, IMHO, a big omission with
regard to other, similar, systems.
-- 
Peter


More information about the maintainers mailing list