2015-07-03 17:10 GMT+02:00 Berker Peksağ <[email protected]>:

> I agree with you on the StringIO and BytesIO cases, but I agree with
> Andriy on the other usages (e.g. ZipFile, GzipFile). Many contributors
> follow the existing practices to write new tests, so it would be nice
> to use best practices if they don't produce too much noise.
>

StringIO and BytesIO are different from files and sockets. The former only
use
RAM while the latter use file descriptors, which are in much scarcer supply
(perhaps 1024 per process).

Leaking file descriptors can cause the process to crash because it exceed
the
systems limit, so it's really bad.

Leaking StringIO or BytesIO doesn't change anything. They'll be closed when
the garbage collector releases them.

That's why I don't believe the analogy holds.

-- 
Aymeric.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CANE-7mXog8YE8LMSxwokaMddjDjcK949wUNzEd_NnLtcknWE_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to