(
        self,
        path: PATH_TYPES,
        text: bool = True,
        encoding: str = "utf-8",
        errors: Optional[str] = None,
    )
return content
Return the contents of the requested file, either a a bytestring or a unicode
        string depending on whether **text** is True
Return the contents of the requested file, either a a bytestring or a unicode
        string depending on whether **text** is True
Return the contents of the requested file either a a bytestring or a unicode string depending on whether ** text ** is True
def read_file(
        self,
        path: PATH_TYPES,
        text: bool = True,
        encoding: str = "utf-8",
        errors: Optional[str] = None,
    ) -> Union[str, bytes]:
        """Return the contents of the requested file, either a a bytestring or a unicode
        string depending on whether **text** is True"""
        content: Union[str, bytes]
        if not errors:
            try:
                errors = sys.getfilesystemencodeerrors()
            except AttributeError:
                errors = "surrogateescape"
        kwargs: Dict[str, Any] = {}
        if errors:
            kwargs["errors"] = errors
        content = self.get_object(self.default_container, str(path))
        if text and isinstance(content, bytes):
            content = content.decode(encoding=encoding, **kwargs)
        return content
def read_file ( self , path : PATH_TYPES , text : bool = True , encoding : str = "utf-8" , errors : Optional [ str ] = None , ) -> Union [ str , bytes ] : content : Union [ str , bytes ] if not errors : try : errors = sys . getfilesystemencodeerrors ( ) except AttributeError : errors = "surrogateescape" kwargs : Dict [ str , Any ] = { } if errors : kwargs [ "errors" ] = errors content = self . get_object ( self . default_container , str ( path ) ) if text and isinstance ( content , bytes ) : content = content . decode ( encoding = encoding , * * kwargs ) return content