libera_utils.io.smart_open.is_resource_exhaustion#

libera_utils.io.smart_open.is_resource_exhaustion(error: BaseException) → bool#

Determine if an error is the host running out of a resource every file read needs.

Such an error says nothing about the file being read: retrying it, or reading another file in the same process, fails the same way.

Parameters:

error (BaseException) – Any exception. Only error itself is examined, not its __cause__ or __context__.

Returns:

True for MemoryError, and for an OSError whose errno is one of the POSIX codes ENOSPC (no space left on device), EDQUOT (disk quota exceeded), EMFILE (per-process open-file limit reached) or ENFILE (system-wide open-file limit reached). False otherwise.

Return type:

bool