Terry J. Reedy added the comment:
I agree that the proposal as written should be rejected. I am inclined to
think this issue should be closed.
I do not understand the claim about 'python -m py_compile'. For me, this does
nothing, as I would expect from reading the code. If args = sys.arg[1:
Éric Araujo added the comment:
I had the same reasoning as RDM when I worked on byte-compilation in
distutils2: https://hg.python.org/distutils2/rev/7c0a88497b5c
Using py_compile or compileall means that you want to create pyc or pyo files.
Defining PYTHONDONTWRITEBYTECODE or -B means that you
R. David Murray added the comment:
The only reason to call py_compile is to get byte code. Honoring
PYTHONDONTWRITEBYTECODE would, IMO, be a bug, at least according to its
documentation (by implication, it isn't explicit about it, and perhaps it
should be).
Your use case could be added as a
New submission from Pavel Roskin:
$ echo "'''Simple script'''" >simple-script
$ PYTHONDONTWRITEBYTECODE=1 python3 -B -m py_compile simple-script
$ ls __pycache__
simple-scriptcpython-35.pyc
py_compile should recognize when the user doesn't want the bytecode to be
produced. Otherwise, it's not u