[issue13585] Add contextlib.CleanupManager

Nikolaus Rath report at bugs.python.org
Wed Dec 21 19:15:11 CET 2011


Nikolaus Rath <Nikolaus at rath.org> added the comment:

On 12/21/2011 12:03 PM, Éric Araujo wrote:
> 
> Éric Araujo <merwok at netwok.org> added the comment:
> 
>>> In the passage I quoted, I don’t understand what is meant by “non-Python resources”.
>> Think about e.g. mounting a file system.
> 
> Ah, ok.  In that case there would still be a Python-level object (just like a Python file object will also release the OS-level handle when it’s closed).

I don't think so.

subprocess.check_call(['mount', 'bla', '/mnt'])

Allocates the resource (mounts the file system) but doesn't leave you
with any Python object.

Best,

   -Nikolaus

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13585>
_______________________________________


More information about the Python-bugs-list mailing list