Guilherme Polo <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2406>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to