[issue22078] io.BufferedReader hides ResourceWarnings when garbage collected

2014-07-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pytho

[issue22078] io.BufferedReader hides ResourceWarnings when garbage collected

2014-07-26 Thread Claudiu Popa
Claudiu Popa added the comment: You're right, thanks for the new information. You can close the issue then. -- ___ Python tracker ___

[issue22078] io.BufferedReader hides ResourceWarnings when garbage collected

2014-07-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This example is not correct. 1) Argument of BufferedReader should be binary stream. >>> import io, gc >>> f = open('/dev/null') >>> bufio = io.BufferedReader(f) >>> bufio.read(1) Traceback (most recent call last): File "", line 1, in AttributeError: '_io.T

[issue22078] io.BufferedReader hides ResourceWarnings when garbage collected

2014-07-26 Thread Claudiu Popa
Claudiu Popa added the comment: I mean this one: $ python_d -Wall -c "f=open('a', 'r'); import io; io.BufferedReader(f)" -- ___ Python tracker ___ __

[issue22078] io.BufferedReader hides ResourceWarnings when garbage collected

2014-07-26 Thread Claudiu Popa
Claudiu Popa added the comment: That's not the same, try with my example. open("a") will be a TextIOWrapper. -- ___ Python tracker ___ ___

[issue22078] io.BufferedReader hides ResourceWarnings when garbage collected

2014-07-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All works to me. $ ./python -Wall -c "open('/dev/null', 'rb')" -c:1: ResourceWarning: unclosed file <_io.BufferedReader name='/dev/null'> -- nosy: +serhiy.storchaka ___ Python tracker

[issue22078] io.BufferedReader hides ResourceWarnings when garbage collected

2014-07-26 Thread Claudiu Popa
New submission from Claudiu Popa: Given the following example, Python 3.5 doesn't emit any resource warning: import io, gc f = open("a") bufio = io.BufferedReader(f) gc.collect() Here's a small patch that enables this. -- components: IO files: buffered_io_resource_warning.patch keywor