def METHOD_NAME(self, site, key, target_path):
    try:
        lookup = key_lookup_for_site(self.config, site)
        data, metadata = self.transfer.get_contents_to_string(key)
        if isinstance(data, str):
            data = data.encode("latin1")
        file_size = len(data)
        with open(target_path, "wb") as target_file:
            output = create_sink_pipeline(
                output=target_file, file_size=file_size, metadata=metadata, key_lookup=lookup, throttle_time=0
            )
            output.write(data)
        return file_size, metadata
    except Exception:
        if os.path.isfile(target_path):
            os.unlink(target_path)
        raise