Message 320146 - Python tracker

Message320146

Author vstinner
Recipients Aaron1011, Oren Milman, ZackerySpytz, martin.panter, nadeem.vawda, serhiy.storchaka, vstinner
Date 2018-06-21.09:41:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529574085.17.0.56676864532.issue23224@psf.upfronthosting.co.za>
In-reply-to
Content
Calling directly __new__() is very unusual, so I'm not surprised that you found bugs. Calling __init__() twice is also an unusal practice. I concur with Serhiy: implementing new instead of init should prevent such bug. I recall that some objects decided instead to raise an exception if they are not fully initialized (if init has not been called), but using new instead of init seems to be safer approach if we can implement it.

In the meanwhile, I blocked by the memory leak (handle leak) in bz2 and lzma: bpo-33916. I proposed a very simple fix: PR 7843. I propose to apply this one since it's easy to backport it to all branches, whereas replacing init with new would be more difficult and risky to backport: I would suggest to only make this change in the master.

What do you think?
History
Date User Action Args
2018-06-21 09:41:25vstinnersetrecipients: + vstinner, nadeem.vawda, martin.panter, serhiy.storchaka, Aaron1011, Oren Milman, ZackerySpytz
2018-06-21 09:41:25vstinnersetmessageid: <1529574085.17.0.56676864532.issue23224@psf.upfronthosting.co.za>
2018-06-21 09:41:25vstinnerlinkissue23224 messages
2018-06-21 09:41:25vstinnercreate