[Python-bugs-list] [ python-Bugs-602345 ] option for not writing .py[co] files

SourceForge.net noreply@sourceforge.net
Sun, 12 Jan 2003 13:39:13 -0800


Bugs item #602345, was opened at 2002-08-30 07:13
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=602345&group_id=5470

Category: Python Interpreter Core
Group: Feature Request
Status: Open
Resolution: None
Priority: 3
Submitted By: Matthias Klose (doko)
Assigned to: Neal Norwitz (nnorwitz)
Summary: option for not writing .py[co] files

Initial Comment:
[destilled from http://bugs.debian.org/96111]

Currently python tries to write the .py[co] files even
in situations, where it will fail, like on read-only
mounted file systems.

In other situations I don't want python trying to write
the compiled files, i.e. having installed the modules
as root as part of a distribution, compiled them
correctly, there is no need to write them. Or compiling
.py files which are configuration files.

Is it reasonable to add an option to python
(--dont-write-compiled-files) to the interpreter, which
doesn't write them? This would not affect existing code
at all.


----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2003-01-12 16:39

Message:
Logged In: YES 
user_id=33168

You are correct about the patch being incomplete.  I still
have to do all the doc.

I hadn't thought about an env't variable or variable in sys.
 Both are certainly reasonable.  I will update the patch.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-01-12 14:47

Message:
Logged In: YES 
user_id=21627

The patch looks good, but is surely incomplete: there should
be patches to the documentation, in particular to the man page.

It might be also desirable to parallel this option with an
environment variable, and/or to expose it writable through
the sys module.

With the environment variable, people could run Python
scripts that won't create .pyc files (as #! /usr/bin/env
python does not allow for further command line options).
With the API, certain applications could declare that they
never want to write .pyc files as they expect to run in
parallel with itself, and might cause .pyc conflicts.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-09-03 11:39

Message:
Logged In: YES 
user_id=6380

I think it's a good idea, but please use a single upper case
letter for the option. Python doesn't support long options
and I'm not about to start doing so.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-09-01 19:30

Message:
Logged In: YES 
user_id=33168

Guido, do you think this is a good idea?  If so, assign back
to me and I'll work up a patch.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=602345&group_id=5470