Skip to content
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

Close the file handle used in exec_file() (for #52) #53

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hotgloupi
Copy link

For python >= 3, a plain FILE* is used, whereas for python2, an object handle takes care of the file object lifetime.
This commit manually closes the file handle after the PyRun_File() call.

For python >= 3, a plain `FILE*` is used, whereas for python2, an object handle takes care of the file object lifetime.
This commit manually closes the file handle after the `PyRun_File()` call.
@paralin
Copy link

paralin commented Feb 26, 2016

I still have this problem, can this be merged soon?

@paralin
Copy link

paralin commented Feb 26, 2016

Actually for some reason this causes an access violation:

0xC0000005: Access violation writing location 0x00000014.

So.. maybe doesn't work quite right :)

@hotgloupi
Copy link
Author

Can you reproduce easily ? Do you have a backtrace ?

@paralin
Copy link

paralin commented Feb 26, 2016

@hotgloupi I undid the patch and don't have a backtrace. Under python 3.4 however it seems the file descriptor was cleaned up already, resulting in multiple fdclose calls on the descriptor. I didn't have too much time to look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants