Skip to content

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

Open
hotgloupi wants to merge 1 commit intoboostorg:developfrom
hotgloupi:patch-1
Open

Close the file handle used in exec_file() (for #52)#53
hotgloupi wants to merge 1 commit intoboostorg:developfrom
hotgloupi:patch-1

Conversation

@hotgloupi
Copy link
Copy Markdown

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
Copy Markdown

paralin commented Feb 26, 2016

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

@paralin
Copy link
Copy Markdown

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
Copy Markdown
Author

Can you reproduce easily ? Do you have a backtrace ?

@paralin
Copy link
Copy Markdown

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.

@stefanseefeld stefanseefeld force-pushed the develop branch 2 times, most recently from 8ccdcff to 3ace4a0 Compare October 8, 2016 17:34
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