◐ Shell
reader mode source ↗
Skip to content

bpo-34170: Fix pymain_run_file()#8660

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:pymain_run_file
Aug 3, 2018
Merged

bpo-34170: Fix pymain_run_file()#8660
vstinner merged 1 commit into
python:masterfrom
vstinner:pymain_run_file

Conversation

@vstinner

@vstinner vstinner commented Aug 3, 2018

Copy link
Copy Markdown
Member

bpo-34170, bpo-34326: Fix pymain_run_file(): use
PyRun_AnyFileExFlags(closeit=1) instead of calling fclose(fp)
explicitly to close the input file before running the code.

https://bugs.python.org/issue34170

bpo-34170, bpo-34326: Fix pymain_run_file(): use
PyRun_AnyFileExFlags(closeit=1) instead of calling fclose(fp)
explicitly to close the input file before running the code.

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

LGTM

@vstinner vstinner merged commit d807862 into python:master Aug 3, 2018
@vstinner vstinner deleted the pymain_run_file branch August 3, 2018 21:54
@vstinner

vstinner commented Aug 3, 2018

Copy link
Copy Markdown
Member Author

Thanks for the review @pablogsal!

@matrixise

Copy link
Copy Markdown
Member

:/ I didn't find it but I was thinking about this function.

@pablogsal

Copy link
Copy Markdown
Member

@matrixise I am afraid that nothing on earth is faster than @vstinner, not even unladen swallows!

@vstinner

vstinner commented Aug 3, 2018

Copy link
Copy Markdown
Member Author

@matrixise I am afraid that nothing on earth is faster than @vstinner, not even unladen swallows!

African or european?

@vstinner

vstinner commented Aug 3, 2018

Copy link
Copy Markdown
Member Author

@matrixise I am afraid that nothing on earth is faster than @vstinner, not even unladen swallows!

More seriously, I knew that I modifed PyRun_AnyFileExFlags() to change when the file is closed. But the full test passed on Linux. It seems like it only failed on specific platforms. Strange. It might be related to os.urandom() private FD, I don't know.

I also noticed that test_subprocess failed on VSTS: macOS, before I merged my PR (the one which introduced the fix), but I don't trust VSTS since this CI has many random failures.

Note: FYI I wrote this fix in my car. But no, I wasn't driving hopefully ;-) I'm now in holiday, see you back in a few weeks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants