Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None,
closefd=True, opener=None, *, loop=None, executor=None):
return AiofilesContextManager(_open(file, mode=mode, buffering=buffering,
encoding=encoding, errors=errors,
newline=newline, closefd=closefd,
opener=opener, loop=loop,
executor=executor))
def __init__(
self, file_path: Union[str, PathLike], *, buffer_size: Optional[int] = None
) -> None:
self.file_path = file_path_to_path(file_path)
self.size = self.file_path.stat().st_size
self.begin = 0
self.end = self.size
if buffer_size is not None:
self.buffer_size = buffer_size
self.file: Optional[AsyncFileIO] = None
self.file_manager: Optional[AiofilesContextManager] = None