[Python-Dev] __pycache__ creation

Antoine Pitrou solipsis at pitrou.net
Mon Mar 22 23:53:35 CET 2010


Le lundi 22 mars 2010 à 23:18 +0100, "Martin v. Löwis" a écrit :
> If Apache creates a folder for me that I cannot remove, most likely,
> there was a configuration error in the first place: common practice
> tells that you should execute user code under user permissions, not as
> www-data.

I'm sure there can be reasons not to do so.
One of them is mass hosting of Python apps: you don't want to create a
separate process per Python user, and therefore you can't run the code
under the "right" user.

> If your code does get run as Apache, this also opens a way of
> not asking for help: just put "os.system('chmod +w /.../__pycache__')"
> into your code, and have Apache run it again.

This is what I meant by "write custom code and get it executed by the
Apache or WSGI handler". Having the Web server execute ad hoc system
administration code is far from elegant and user-friendly.

> So I don't think this is any more unfriendly than creating .pyc files in
> the first place, and the advantages of uniformity of this new approach
> certainly outweigh the disadvantages.

I don't see the "advantages of uniformity".

What we had initially was a way to solve problems which are specific to
Ubuntu and Debian packagers, and which was only to be activated by those
people on those systems.

We now end with an alleged complete solution to a problem which doesn't
seem to exist, or is at least vastly overblown (the idea that having pyc
files along their source counterparts is a nuisance doesn't seem to be a
common grief against Python).

I would really recommend reexamining it, rather than falling for the
shiny new thing.

Regards

Antoine.




More information about the Python-Dev mailing list