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 phantal
Recipients Jim Crigler, blastwave, christian.heimes, petriborg, phantal, vstinner
Date 2020-08-04.04:04:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596513896.14.0.030239368519.issue29269@roundup.psfhosted.org>
In-reply-to
Content
I accidentally hit submit too early.

I tried changing the code in posixmodule.c to use lseek(), something like the following:

offset = lseek( in, 0, SEEK_CUR );

do {
  ret = sendfile(...);
} while( ... );
lseek( in, offset, SEEK_SET );

... however, in addition to readfile not advancing the file pointer it also doesn't seem to cause an EOF condition.  In my first attempt at the above I was doing this after the loop:

lseek( in, offset, SEEK_CUR );

... and it just kept advancing the file pointer well beyond the end of the file and sendfile() had absolutely no qualms about reading beyond the end of the file.

I even tried adding a read() after the 2nd lseek to see if I could force an EOF condition but that didn't do it.
History
Date User Action Args
2020-08-04 04:04:56phantalsetrecipients: + phantal, vstinner, christian.heimes, petriborg, blastwave, Jim Crigler
2020-08-04 04:04:56phantalsetmessageid: <1596513896.14.0.030239368519.issue29269@roundup.psfhosted.org>
2020-08-04 04:04:56phantallinkissue29269 messages
2020-08-04 04:04:56phantalcreate