This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients christian.heimes, gvanrossum, loewis
Date 2007-10-29.20:49:11
SpamBayes Score 0.38996416
Marked as misclassified No
Message-id <1193690951.97.0.259734151069.issue1351@psf.upfronthosting.co.za>
In-reply-to
Content
I'm -1 myself.  I've rarely needed this -- if I wanted to know the size,
I was almost always going to read the data into memory anyway, so why
not just read it and then ask how much you got?  For files on the
filesystem there's os.path.getsize().

If I ever were to let this in, here's some more criticism:

(a) the SizeInfo class is overkill.  getsize() should just return an int.

(b) getsize() should check self.seekable() first and raise the
appropriate error if the file isn't seekable.

(c) os.fstat() is much less likely to work than the tell-seek-tell-seek
sequence, so why not use that everywhere?

(d) people will expect to use this on text files, but of course the
outcome will be in bytes, hence useless.
History
Date User Action Args
2007-10-29 20:49:12gvanrossumsetspambayes_score: 0.389964 -> 0.38996416
recipients: + gvanrossum, loewis, christian.heimes
2007-10-29 20:49:12gvanrossumsetspambayes_score: 0.389964 -> 0.389964
messageid: <1193690951.97.0.259734151069.issue1351@psf.upfronthosting.co.za>
2007-10-29 20:49:11gvanrossumlinkissue1351 messages
2007-10-29 20:49:11gvanrossumcreate