On Mon, 7 Feb 2011, Eric Stevens wrote:

Hi:
I am relatively new to Python and have been recently trying to experiment
with its zipfile capabilities. However, everytime I try to open a zip (
using method zipfile.ZipFile(open('zipfile.zip','r')) ) I continue to get an
error message that states:error: unpack requires a string argument of length
46. Would anyone be able to help me figure out what is wrong? I am currently
running Python 2.7 on Windows (not sure if that matters). Thank you.

zip files are not ascii text, so in order to send it to the zipfile you need to open it with the 'rb' flag to indicate you want to read in binary mode.

HTH,
Wayne
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to