[issue21146] update gzip usage examples in docs

INADA Naoki report at bugs.python.org
Thu Apr 3 13:57:06 CEST 2014


INADA Naoki added the comment:

Maybe, shutil.copyfileobj() is good.

import gzip
import shutil

with open(src, 'rb') as f_in:
    with gzip.open(dst, 'wb') as f_out:
        shutil.copyfileobj(f_in, f_out)

----------
nosy: +naoki

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21146>
_______________________________________


More information about the Python-bugs-list mailing list