I see. Thanks for that. dave
-----Original Message----- From: Kent Johnson [mailto:[EMAIL PROTECTED] Sent: 20 February 2007 13:30 To: Barton David Cc: tutor@python.org Subject: Re: [Tutor] file.read() doesn't give full contents of compressed files Barton David wrote: > Oh... of course. Thanks and sorry for missing the bleeding obvious. > > Mind you, when reading in 'txt mode' rather than binary, len() > actually gives a much *smaller* size than getsize. Does the conversion > into txt happen to introduce some sort of terminator character that > stops > file.read() from going to the end? Actually, yes. A ctrl-Z is treated as an end-of-file when reading a file in text mode on Windows. http://groups.google.com/group/comp.lang.python/msg/4604aac0222a0043?hl= en& Kent This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor