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 neologix
Recipients Kuberan.Naganathan, jcea, neologix, pitrou, vstinner
Date 2011-07-22.20:35:06
SpamBayes Score 5.3744176e-10
Marked as misclassified No
Message-id <CAH_1eM2eh0io5_Bi-1KP2NZn8mfq8ndE=JOinsHBb2fs-yN_RQ@mail.gmail.com>
In-reply-to <1311149926.15.0.754151765935.issue12545@psf.upfronthosting.co.za>
Content
Patch attached.

> For lseek, we can rely on errno. Try something like that:
>
> errno = 0;
> offset = lseek(...);
> if (offset == (off_t)-1 && errno) /* error */
>

It's a little bit overkill :-) (for mktime, time_t can overflow easily
on 32-bit).

> We can write a test using a sparse file... Or maybe a mmap object?
>

I'm not sure it's easily testable, because it's really a corner case
not addressed by POSIX. On my Linux box, I can't get lseek to return a
negative value, I get EINVAL - which does make sense (the Linux kernel
doesn't accept or return negative file offsets, see
http://lwn.net/Articles/138063/).

Kuberan, on what operating system did you notice this problem? Solaris?
Files
File name Uploaded
lseek_negative.diff neologix, 2011-07-22.20:35:05
History
Date User Action Args
2011-07-22 20:35:06neologixsetrecipients: + neologix, jcea, pitrou, vstinner, Kuberan.Naganathan
2011-07-22 20:35:06neologixlinkissue12545 messages
2011-07-22 20:35:06neologixcreate