[New-bugs-announce] [issue12545] Incorrect handling of return codes in the posix_lseek function in posixmodule.c

Kuberan Naganathan report at bugs.python.org
Wed Jul 13 05:29:19 CEST 2011


New submission from Kuberan Naganathan <kubiyak at gmail.com>:

The lseek function can legitimately return a code less then zero ( except for -1 ) when seeking beyond an offset of 2^63.  This behavior should be supported in order to permit the python interpreter to seek in files with valid data at locations greater than or equal to 2^63.  This can happen in a sparse file or in the /proc file system address space file.  

The fix is simple.  In the posix_lseek function check for result != -1 instead of checking for result < 0 in return code checks of the value returned by lseek.

----------
components: IO
messages: 140222
nosy: Kuberan.Naganathan
priority: normal
severity: normal
status: open
title: Incorrect handling of return codes in the posix_lseek function in posixmodule.c
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12545>
_______________________________________


More information about the New-bugs-announce mailing list