Hello everyone I pickled a list of dictionaries to a file using the below code
fd = open(file_name,'ab')
for i in listOFDicts:
pickle.dump(i,fd)
fd.close()
Then Now I want to load it using the below code
with open(filename, 'rb') as pickleFile:
content = pickle.loads(pickleFile)
and I get this error "a bytes-like object is required, not '_io.BufferedReader'"
when I use load() instead of loads()
I get this error
"UnicodeDecodeError: 'ascii' codec can't decode byte 0xc6 in position 0: ordinal not in range(128)"
and if I used pickle.load(filename, encoding='latin1')
I get this error "ModuleNotFoundError: No module named 'bson'"
any help would be really appreciated
Sincerely