[issue4633] file.tell() gives wrong result

2008-12-11 Thread Tim Gordon
Tim Gordon <[EMAIL PROTECTED]> added the comment: Try using the readline method instead of next. I don't think that applies the same buffering. ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4633] file.tell() gives wrong result

2008-12-11 Thread Yavuz Onder
Yavuz Onder <[EMAIL PROTECTED]> added the comment: O.K. But, is there a way to backtrack to the beginning of the last read line, without explicitly implementing accounting of the real file pointer in the code, and doing "seek(,0)"? The documentation you pointed to implies that, in "for name in

[issue4633] file.tell() gives wrong result

2008-12-11 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- resolution: -> wont fix status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue4633] file.tell() gives wrong result

2008-12-11 Thread Tim Gordon
Tim Gordon <[EMAIL PROTECTED]> added the comment: See the documentation for file.next (http://docs.python.org/library/stdtypes.html#file.next). As you can see, file.next uses a buffer which will mess with the result of other methods, such as file.tell. -- nosy: +QuantumTim _

[issue4633] file.tell() gives wrong result

2008-12-11 Thread Yavuz Onder
New submission from Yavuz Onder <[EMAIL PROTECTED]>: I find that file.tell returns not the byte offset of the next byte, but possibly the byte offset of the next block to be read. I find it always to be a multiple of 1024. Following is a demo of the bug. where I read a few lines into a text file