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 vstinner
Recipients Kuberan.Naganathan, jcea, neologix, pitrou, vstinner
Date 2011-07-20.08:18:45
SpamBayes Score 3.0504155e-11
Marked as misclassified No
Message-id <1311149926.15.0.754151765935.issue12545@psf.upfronthosting.co.za>
In-reply-to
Content
> So I'd suggest forgetting about this part.

If someone really wants this feature (relative seek of more than 2^63), he/she should open a new issue.

This issue remembers me a mktime() issue: mktime() may return -1 even if it is not an error. time_mktime() uses now a sentinel to detect an error:

    buf.tm_wday = -1;  /* sentinel; original value ignored */
    tt = mktime(&buf);
    /* Return value of -1 does not necessarily mean an error, but tm_wday
     * cannot remain set to -1 if mktime succeeded. */
    if (tt == (time_t)(-1) && buf.tm_wday == -1) /* OverflowError */

For lseek, we can rely on errno. Try something like that:

errno = 0;
offset = lseek(...);
if (offset == (off_t)-1 && errno) /* error */

We can write a test using a sparse file... Or maybe a mmap object?
History
Date User Action Args
2011-07-20 08:18:46vstinnersetrecipients: + vstinner, jcea, pitrou, neologix, Kuberan.Naganathan
2011-07-20 08:18:46vstinnersetmessageid: <1311149926.15.0.754151765935.issue12545@psf.upfronthosting.co.za>
2011-07-20 08:18:45vstinnerlinkissue12545 messages
2011-07-20 08:18:45vstinnercreate