Code:
import pickle
f = open("filepath/test.txt","w")
f.write(" writing to a output file") # works
pickle.dump([1,2,3],f) # fails with error "TypeError: write() argument must be str, not bytes"
f.close()
Is pickle module not meant to overcome the issue of having to convert to string before writing to a file?