Neil Schemenauer <nas-pyt...@arctrix.com> added the comment:

Yeah, I think you are correct.  Currently files not part of reference cycles 
get properly flushed and closed by the reference counter.  Implementing my 
"buffer_register_flush" patch would cause files to be closed only by the cyclic 
garbage collector (if not explicitly closed).  That would mean a script that 
opens a large number of files could run out of file descriptors.  Basically, we 
lose one of the main advantages of reference counting.

Probably the GC should keep track of how many files are open and call collect() 
when a threshold is reached.  Still, forcing every file to be collected only by 
the cyclic GC seems too ugly of a solution to this issue.

----------

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

Reply via email to