For Python2.7, Use io.open() in both locations.
import io
import shutil
with io.open('/etc/passwd', encoding='latin-1', errors="ignore") as source:
with io.open('/tmp/goof', mode="w", encoding='utf-8') as target:
shutil.copyfileobj(source, target)
The above program runs without errors on my PC.