[Python-bugs-list] [ python-Bugs-420502 ] seek/tell beyond eof without exceptions
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 07 May 2001 21:33:40 -0700
Bugs item #420502, was updated on 2001-05-01 10:40
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=420502&group_id=5470
Category: Python Interpreter Core
Group: None
>Status: Closed
>Resolution: Works For Me
Priority: 5
Submitted By: Grzegorz Makarewicz (mpmak)
Assigned to: Nobody/Anonymous (nobody)
Summary: seek/tell beyond eof without exceptions
Initial Comment:
Methods from FileObject like seek/tell doesn`t check
for errno value. The result is that python exceptions
aren`t throwned.
Small example:
import sys
SEEK_END = 2
def main():
fp=open(sys.argv[0],'rb')
fp.seek(0,SEEK_END)
off = fp.tell()
fp.seek(off,SEEK_END)
x = fp.tell()
print 'tell?',x
main()
----------------------------------------------------------------------
>Comment By: Jeremy Hylton (jhylton)
Date: 2001-05-07 21:33
Message:
Logged In: YES
user_id=31392
The seek and tell methods do check the return value and
raise
an exception if the C function returns an error. I don't
believe
a seek call will fail merely because it seeks beyond the end
of a file.
If you've got a legit bug, please include a C program that
demonstrates the correct behavior.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=420502&group_id=5470