Mar-29-2017, 01:52 AM
(This post was last modified: Mar-29-2017, 01:52 AM by tannishpage.)
So I am trying to not use shutil or os libraries. So what i tried is:
TypeError: a bytes-like object is required, not '_io.BufferedReader'
How am I supposed to do it using this method.Â
I need this to work for any file type.
  fileOriginal = open(filename, "rb")     os.chdir(destination) #In this case destination is a full path.     fileDuplicate = open(filename, "wb")     fileDuplicate.write(fileOriginal)     fileOriginal.close()     fileDuplicate.close()This is what i have so far. But this throws this error:Â
TypeError: a bytes-like object is required, not '_io.BufferedReader'
How am I supposed to do it using this method.Â
I need this to work for any file type.