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
erroritself is examined, not its__cause__or__context__.- Returns:
True for
MemoryError, and for anOSErrorwhoseerrnois one of the POSIX codesENOSPC(no space left on device),EDQUOT(disk quota exceeded),EMFILE(per-process open-file limit reached) orENFILE(system-wide open-file limit reached). False otherwise.- Return type: