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 christian.heimes
Recipients christian.heimes, gvanrossum, loewis
Date 2007-11-08.14:59:55
SpamBayes Score 0.1225405
Marked as misclassified No
Message-id <1194533996.25.0.318061849639.issue1351@psf.upfronthosting.co.za>
In-reply-to
Content
> (a) the SizeInfo class is overkill.  getsize() should just return an int.

But I like overkill :)

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

That's easy to implement

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

fstat doesn't have concurrency problems in multi threaded apps. I
haven't profiled it but I would guess that fstat is also faster than
tell seek.

> (d) people will expect to use this on text files, but of course the
outcome will be in bytes, hence useless.

I could rename the method to getfssize, getbytesize, getsizeb ... to
make clear that it doesn't return the amount of chars but the amount of
used bytes.
History
Date User Action Args
2007-11-08 14:59:56christian.heimessetspambayes_score: 0.122541 -> 0.1225405
recipients: + christian.heimes, gvanrossum, loewis
2007-11-08 14:59:56christian.heimessetspambayes_score: 0.122541 -> 0.122541
messageid: <1194533996.25.0.318061849639.issue1351@psf.upfronthosting.co.za>
2007-11-08 14:59:56christian.heimeslinkissue1351 messages
2007-11-08 14:59:55christian.heimescreate