This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cameron
Recipients Gregory Shevchenko, cameron, nanjekyejoannah, vstinner
Date 2020-07-17.01:58:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594951124.57.0.908162502334.issue40456@roundup.psfhosted.org>
In-reply-to
Content
Since bad input causes py_compile.py to issue an error like this:

  File "/usr/local/Cellar/python@3.8/3.8.3/Frameworks/Python.framework/Versions/3.8/lib/python3.8/py_compile.py", line 213, in main
    if quiet < 2:
NameError: name 'quiet' is not defined

I suggest, to save long review of a larger PR elsewhere, can we please just initially apply a patch like this:

[~/src/cpython(git:py_compile-quiet-not-initialised)]fleet2*> diff
+ exec git diff
diff --git a/Lib/py_compile.py b/Lib/py_compile.py
index 21736896af..cea851274d 100644
--- a/Lib/py_compile.py
+++ b/Lib/py_compile.py
@@ -186,6 +186,7 @@ def main(args=None):
     """
     if args is None:
         args = sys.argv[1:]
+    quiet = 0
     rv = 0
     if args == ['-']:
         while True:

Then the runtime issue goes away, and adding the feature fully can be addressed in a more leisurely fashion.
History
Date User Action Args
2020-07-17 01:58:44cameronsetrecipients: + cameron, vstinner, nanjekyejoannah, Gregory Shevchenko
2020-07-17 01:58:44cameronsetmessageid: <1594951124.57.0.908162502334.issue40456@roundup.psfhosted.org>
2020-07-17 01:58:44cameronlinkissue40456 messages
2020-07-17 01:58:44cameroncreate