Copying a stream in Python September 13, 2023 by Tarik shutil.copyfile and shutil.copyfileobj for the rescue. See http://docs.python.org/library/shutil.html#module-shutil