Context manager openers for various fileobject types
Opener(fileish, *args, **kwargs) | Class to accept, maybe open, and context-manage file-likes / filenames |
Bases: object
Class to accept, maybe open, and context-manage file-likes / filenames
Provides context manager to close files that the constructor opened for you.
Parameters: | fileish : str or file-like
*args : positional arguments
**kwargs : keyword arguments
|
---|
Close self.fobj iff we opened it in the constructor
whether to ignore case looking for compression extensions
default compression level when writing gz and bz2 files
Return self.fobj.name or self._name if not present
self._name will be None if object was created with a fileobj, otherwise it will be the filename.