[issue2406] Improvement suggestions for the gzip module documentation

Guilherme Polo report at bugs.python.org
Thu Mar 27 12:22:30 CET 2008


Guilherme Polo <ggpolo at gmail.com> added the comment:

Hello,

(some comments)

What about using gzip.open instead of GzipFile ? It is just a shorthand,
but I prefer it (just my opinion). Also, remove those semicolons.

At the second example you called close on the string object, I guess you
intended to do file_obj.close()

In the third example you used "file", please change that to "open". In
this sample example, you don't need to use shutil. I suggest changing it to:

import gzip
f_in = open('/home/joe/file.txt', 'rb')
f_out = gzip.open('/home/joe/file.txt.gz', 'wb');
f_out.writelines(f_in)
file_obj_out.close()
f_out.close()

Finally, consider doing these changes against Doc/library/gzip.rst and
sending the diff

----------
nosy: +gpolo

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2406>
__________________________________


More information about the Python-bugs-list mailing list