I'm trying to check for errors in python code, and I need access to the error log itself (I can't just check to see if the .pyc file was created).
My current process is I have a script to run python3 -m py_compile test.py, where test.py is "aegsedrg" and nothing else (in other words, invalid python code).
When python3 test.py is run, the result is an error (as expected):
Traceback (most recent call last):
File "test.py", line 1, in <module>
aegsedrg
NameError: name 'aegsedrg' is not defined
However, python3 -m py_compile test.py returns (through stdout or stderr) no errors.
This is on a Ubuntu 16.04 server, and I have recently upgraded and updated it. I have also completely reinstalled Python 3. I don't think this is a permission issue, test.py is 777.
Why does python3 -m py_compile test.py return nothing?
-edit-
I have also tried to use the following python script to do this:
import py_compile
print("Here")
py_compile.compile("test.py")
print("Here2")
The output is "Here" and then "Here2".