-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start pyc file lock the file #77632
Comments
Python v3.6.4:d48eceb 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 : But, when I compile the file to .pyc (with py_compile with an another script), and I launch the pyc like : It's normal ? |
Same for python v3.6.5:f59c0932b4 |
There's no specific reason as to why that would happen as no files are kept open after importing is finished. |
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(). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: