[ python-Bugs-1121152 ] file seek error

SourceForge.net noreply at sourceforge.net
Sat Feb 12 02:54:58 CET 2005


Bugs item #1121152, was opened at 2005-02-11 19:36
Message generated for change (Settings changed) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1121152&group_id=5470

Category: Python Library
>Group: Not a Bug
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Richard Lawhorn (lawhorn999)
Assigned to: Nobody/Anonymous (nobody)
Summary: file seek error

Initial Comment:
When opening a file for overwrite ("rb+"), sucessive
read/writes fail to advance the pointer. The tell()
indicates that the pointer is advancing, but the
resulting file simply repeats an earlier record.

See attached file for an example.  

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2005-02-11 20:54

Message:
Logged In: YES 
user_id=31435

Sorry, write the code in C and you'll see the same behavior.  
For a file opened for update, the effect of input followed by 
output is undefined unless a file-positioning call is made 
between the I/O calls; the effect of output followed by input 
is also undefined, unless a file-positioning call or a call to flush
() is made between them.  Your comment "This line should 
NOT be needed" is simply incorrect:  you are in fact trying to 
do input immediately following output.  If you want defined 
behavior, then you must seek between them, and/or flush() 
after the write().

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1121152&group_id=5470


More information about the Python-bugs-list mailing list