# xarray.backends.FileManager.acquire_context

#### FileManager.acquire_context(needs_lock=True)[[source]](https://github.com/pydata/xarray/blob/main/xarray/backends/file_manager.py#L94-L103)

Context manager for acquiring a file. Yields a file object.

The context manager unwinds any actions taken as part of acquisition
(i.e., removes it from any cache) if an exception is raised from the
context. It *does not* automatically close the file.
