[Python-Dev] .pyc location?

Georg Brandl g.brandl at gmx.net
Fri Nov 23 15:22:05 CET 2007


Andreas Raab schrieb:
> Hi -
> 
> I'm having a few problems with our (embedded) Python interpreter trying 
> to write .pyc files in the installation of our product (which actually 
> sometimes works and sometimes doesn't depending on OS and paranoia level 
> involved). This can give raise to a few very confusing situations and 
> I'd like to be able to specify an explicit location for the .pyc files. 
> Ideally, this would be a cache location where all .pyc files are created 
> under an hashed (MD5 or similar) name of the original source file so 
> that the cache location can be used for all of the compiled Python files.
> 
> While googling this issue, I noticed that the status of PEP 304 says 
> "withdrawn" but since most of the discussion around it seems to be a 
> couple of years old, I thought I'd ask if anyone has done something in 
> this area recently. If not, a pointer to the place which manages these 
> mappings (or a starting point for further digging) would be greatly welcome.

There is this issue: http://bugs.python.org/issue602345 which contains a
patch that adds a Python option to not write .pyc files at all. As far as
I know, there is no further work in the direction of PEP 304.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list