[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-19 Thread Georg Brandl
Georg Brandl added the comment: Committed in r60084. -- nosy: +georg.brandl resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ _

[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-14 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: Here is a patch, as per description above. Added file: http://bugs.python.org/file9160/addpatch __ Tracker <[EMAIL PROTECTED]> __ _

[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-11 Thread Christian Heimes
Christian Heimes added the comment: I don't mind if you like to pursue the issue. I won't invest any time into it. But if you can come up with a patch we can surely apply it. __ Tracker <[EMAIL PROTECTED]> ___

[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-11 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: I agree that a leak would very rarely occur in practice, but since there is a straightforward fix, why not apply it? If nothing else, the code in the core should be an example of writing leak-free Python/C code, and a fix will also prevent others from wasting tim

[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-10 Thread Guido van Rossum
Guido van Rossum added the comment: These are meant purely for the convenience of module initialization, and there correct handling of reference counts in the light of failures is of marginal importance. So while these may technically have leaks, you shouldn't care. -- nosy: +gvanrossum

[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-10 Thread Christian Heimes
Christian Heimes added the comment: Thanks for your analysis! I *think* you are right but I've to study the code more carefully before I can make a decision. We can't target the change for 2.5 though. Guido would accuse my of being insane again. *g* The problem should be discussed at the upcoming

[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-10 Thread Hrvoje Nikšić
New submission from Hrvoje Nikšić: PyModule_AddObject has somewhat strange reference-counting behavior in that it *conditionally* steals a reference. In case of error it doesn't change the reference to the passed object, but in case of success it steals it. This means that, as written, PyModule