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 yanlinlin82
Recipients neologix, vstinner, yanlinlin82
Date 2014-06-03.01:35:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
I agree that Python 2 should use fopen / fread rather than directly read().
But you may misunderstand this. The 'strace' tool reports Linux system
calls, including read() rather than fread(), and I guess that read() should
be finally called in fread() implementation.

What I mean is that Python 2's seek(0, 2) does not use fseek(0, SEEK_END),
but fseek(somewhere, SEEK_SET) and fread(rest-bytes) instead, which is too
inefficient in some kind of storage.

By the way, Python 3 does not behavior like this.

On Tue, Jun 3, 2014 at 4:35 AM, STINNER Victor <>

> STINNER Victor added the comment:
> I don't think that Python calls directly read(). Python 2 uses fopen /
> fread.
> Python 3 doesn't use buffered files, but call open / read directly.
> ----------
> nosy: +haypo, neologix
> _______________________________________
> Python tracker <>
> <>
> _______________________________________
Date User Action Args
2014-06-03 01:35:27yanlinlin82setrecipients: + yanlinlin82, vstinner, neologix
2014-06-03 01:35:27yanlinlin82linkissue21638 messages
2014-06-03 01:35:26yanlinlin82create