On Mon, May 4, 2015 at 9:17 AM, Peter Otten <__pete...@web.de> wrote: > OK, you convinced me. Then I tried: > >>>> with open("tmp.txt", "wb") as f: f.write("0\r\n3\r5\n7") > ... >>>> assert len(open("tmp.txt", "rb").read()) == 8 >>>> f = open("tmp.txt", "rU") >>>> f.readline() > '0\n' >>>> f.newlines >>>> f.tell() > 3 >>>> f.newlines > '\r\n' > > Hm, so tell() moves the file pointer? Is that sane?
If I call readline() followed by tell(), I expect the result to be the position of the start of the next line. Maybe this is considered safe because tell() on a pipe raises an exception? -- https://mail.python.org/mailman/listinfo/python-list