Linlin Yan added the comment: 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 <rep...@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 <rep...@bugs.python.org> > <http://bugs.python.org/issue21638> > _______________________________________ > ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21638> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com