[issue14505] PyFile_FromString leaks file descriptors in python 2.7

2012-04-05 Thread STINNER Victor
STINNER Victor added the comment: > Victor, what exactly are you talking about? > http://hg.python.org/cpython/rev/0f5b64630fda/ *does* change > PyFile_FromString. Oh. I don't know (remember) why I did this change!? I suppose that I changed it to test something and then forget to remove the t

[issue14505] PyFile_FromString leaks file descriptors in python 2.7

2012-04-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Matthias, this should be fixed now. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed type: -> resource usage ___ Python tracker _

[issue14505] PyFile_FromString leaks file descriptors in python 2.7

2012-04-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8258e5fa4a19 by Antoine Pitrou in branch '2.7': Issue #14505: Fix file descriptor leak when deallocating file objects created with PyFile_FromString(). http://hg.python.org/cpython/rev/8258e5fa4a19 -- nosy: +python-dev ___

[issue14505] PyFile_FromString leaks file descriptors in python 2.7

2012-04-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Victor, what exactly are you talking about? http://hg.python.org/cpython/rev/0f5b64630fda/ *does* change PyFile_FromString. And Matthias mentioned that the problem didn't occur with 2.6. -- ___ Python tracker

[issue14505] PyFile_FromString leaks file descriptors in python 2.7

2012-04-05 Thread STINNER Victor
STINNER Victor added the comment: > Victor, that sounds like a strange behaviour to me. We may change PyFile_FromString() to call fclose() when the file is closed explicitly (call its close() method), but it may break backward compatibility. I prefer to document the behaviour instead. > PyFile

[issue14505] PyFile_FromString leaks file descriptors in python 2.7

2012-04-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Victor, that sounds like a strange behaviour to me. PyFile_FromString is a public API and maybe it shouldn't have changed between 2.6 and 2.7. -- ___ Python tracker _

[issue14505] PyFile_FromString leaks file descriptors in python 2.7

2012-04-05 Thread STINNER Victor
STINNER Victor added the comment: > File descriptors opened by PyFile_FromString don't get closed > when the reference count is decreased. Correct, PyFile_FromString() doesn't close the file descriptor, even if you call its close() method. You have to call manually fclose(file->f_fp). Or you

[issue14505] PyFile_FromString leaks file descriptors in python 2.7

2012-04-05 Thread Matthias Klose
Changes by Matthias Klose : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue14505] PyFile_FromString leaks file descriptors in python 2.7

2012-04-05 Thread Matthias Klose
New submission from Matthias Klose : [forwarded from http://bugs.debian.org/664529] seen with 2.7.3 rc2 File descriptors opened by PyFile_FromString don't get closed when the reference count is decreased. Here's my test program, pythony.c: #include int main() { int i = 0; PyObject *obj;