Hello,

here's a strange bug (?) I've came across (using Python 2.2):

# loop_1
for line in file:
    if some_condition(line): break
    do_something()

# loop_2
for line in file:
    do_something_else()

The problem is, that loop_2 doesn't resume where loop_1 left off, but
skips many lines (a block's worth or so) before continuing.

Why is this? Is reading from a file non-reentrant?

It is always possible to slurp the whole file content into a list, and
then iterate through the list, but I want to handle HUGE files too.

Thanks,
-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to