Author yanlinlin82
Recipients neologix, vstinner, yanlinlin82
Date 2014-06-03.01:35:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CA+YjnUsrR=vz_U0EyAFbpJguErFgpVPOvnLkq7vdksXHH1TRrw@mail.gmail.com>
In-reply-to <1401741317.88.0.623714981685.issue21638@psf.upfronthosting.co.za>
Content
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 <report@bugs.python.org>
wrote:

>
> 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 <report@bugs.python.org>
> <http://bugs.python.org/issue21638>
> _______________________________________
>
History
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