You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I search on Internet and I don't find why Python Interpreter (v3.6.4) do that. With python 2.7, I don't have this "problem".
When I launch script like :
While the execution, I can rename/modify the file "compile.py".
But, when I compile the file to .pyc (with py_compile with an another script), and I launch the pyc like :
While the execution, I CAN'T rename/modify the file because is locked by Python Interpreter.
In Python/pythonrun.c, PyRun_SimpleFileExFlags() reopens the PYC file in binary mode, passes it to run_pyc_file(), and only closes it after executing the script. The file should instead be closed in run_pyc_file(), before calling PyEval_EvalCode().