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 larsoner
Recipients Andrew Nelson, Paul Silisteanu, cjrh, larsoner, pablogsal, ralf.gommers, stefanor
Date 2020-04-10.18:21:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586542892.67.0.255577044729.issue38501@roundup.psfhosted.org>
In-reply-to
Content
> Why? This is a resource like any other and it requires proper resource management. Would you also put a big warning on "open()" stating that opening a file requires either using a context manager or ensure a manual close()?

One potential reason would be that the consequences of bad resource management in this case are different than in the open() case, i.e., here the interpreter hangs -- or Travis runs for your repo (SciPy) get stuck with over-50-minute errors, which is how we started looking for how to track it down.

> > the first Python 2.7 example in the docs 

> Python 2.7 is not supported and the pool has changed *a lot* since Python 2. 

Indeed, my point is more about potential prevalence: this (now incorrect) problematic usage pattern was the first example in the docs for multiprocessing for a long time, indicating that there might be a lot of code in the wild that might (still) make use of it.

> Yeah, and CPython does not promise that the __del__ method of any object will be called, so is not assured that the finalized will call close():

Ahh, I didn't know that. This might be another good reason to add a warning about the risks of not ensuring closure yourself: others might have the same gap in knowledge I had, and assume the docs are saying that things will be taken care of by garbage collection on exit when they will not.

But you of course cannot document every possible problematic situation users could put themselves in, so I leave it up to your judgment whether or not it's worth it in this case.
History
Date User Action Args
2020-04-10 18:21:32larsonersetrecipients: + larsoner, cjrh, stefanor, ralf.gommers, pablogsal, Andrew Nelson, Paul Silisteanu
2020-04-10 18:21:32larsonersetmessageid: <1586542892.67.0.255577044729.issue38501@roundup.psfhosted.org>
2020-04-10 18:21:32larsonerlinkissue38501 messages
2020-04-10 18:21:32larsonercreate