I am copying a pdf file  to local, using the following piece of code:
with self.input_target().open('r') as r:
    with self.output_target().open('w') as w:
       for line in r: 
           w.write(line) 
Which is based in this question (kind of)
But when I execute that code I get the following:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 11:
      invalid continuation byte
I tried this other approach, without good results:
   with self.input_target().open('r') as r, self.output_target().open('w') as w:                                                                                                                        
       w.write(r.read())                         
What is the correct way of doing it?