This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Arfrever, akira, martin.panter, piotr.dobrogost, pitrou, serhiy.storchaka, vstinner
Date 2016-03-24.15:36:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1458833800.28.0.0761624538707.issue19829@psf.upfronthosting.co.za>
In-reply-to
Content
> I don't like _dealloc_warn() at all. It looks as a dirty hack and doesn't work with custom file-like objects.

I tried to support emitting a ResourceWarning when the close() method is overriden in a subclass, but then I saw that io doesn't support this use case neither:
---
import io
import os

class MyFile(io.FileIO):
    def close(self):
        os.close(self.fileno())

f = MyFile('/etc/issue')
f = None
---
=> no warning

Ok, now I have to read again Martin's patches since I didn't understand them at the first read :-)
History
Date User Action Args
2016-03-24 15:36:40vstinnersetrecipients: + vstinner, pitrou, Arfrever, akira, martin.panter, piotr.dobrogost, serhiy.storchaka
2016-03-24 15:36:40vstinnersetmessageid: <1458833800.28.0.0761624538707.issue19829@psf.upfronthosting.co.za>
2016-03-24 15:36:40vstinnerlinkissue19829 messages
2016-03-24 15:36:40vstinnercreate