Am using this code to read a file with pickle but inside an async function
async with aiofiles.open("owners.pkl", mode="rb") as file:
owner_dict = pickle.loads(await file.read())
But I get this error
owner_dict = pickle.loads(await file.read())
_pickle.UnpicklingError: invalid load key, '\xef'.
I just want a valid way to open files and read or write in them using pickle inside async-await functions