def content_bytes(self) -> bytes:
        """
        Get the content of this file as a bytestring.

        May raise if backed by a real file (`abs_src_path`) if it cannot be read.

        If used as a setter, it defines the content of the file, and `abs_src_path` becomes unset.
        """
        content = self._content
        if content is None:
            assert self.abs_src_path is not None
            with open(self.abs_src_path, 'rb') as f:
                return f.read()
        if not isinstance(content, bytes):
            content = content.encode()
        return content

        Get the content of this file as a bytestring.

        May raise if backed by a real file (`abs_src_path`) if it cannot be read.

        If used as a setter, it defines the content of the file, and `abs_src_path` becomes unset.
        
mkdocs/structure/files.py