Python 3: why tell() function after first readline() raises MemoryError? -
i have strange issue python 3.2.5 on cygwin. wonder if cygwin-specific bug, cannot check now. after read 1 line text file, next tell() raises memoryerror. can tell if normal behavior , why?
>>> f = open("file.txt","r") >>> f.tell() 0 >>> f.readline() '#!/bin/bash\n' >>> f.tell() traceback (most recent call last): file "<stdin>", line 1, in <module> memoryerror >>> on other hand, after seek() ok:
>>> f = open("file.txt","r") >>> >>> f.seek(10) 10 >>> f.tell() 10 >>>
Comments
Post a Comment