STINNER Victor <victor.stin...@haypocalc.com> added the comment:

> 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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12545>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to