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 "<stdin>", line 1, in <module>
AttributeError: '_io.TextIOWrapper' object has no attribute 'readinto'

2) gc.collect() doesn't collect file streams because references to them are 
saved in local variables.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22078>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to