python-inotify-tail_example icon indicating copy to clipboard operation
python-inotify-tail_example copied to clipboard

Multiline-write results in unexpected behavior

Open petski opened this issue 12 years ago • 0 comments

An issue reveals itself if the process writing to the tail'ed logfile writes more than one line in a write().

To reproduce:

$ echo 1 >> /tmp/myfile
$ echo 2 >> /tmp/myfile
$ echo -e "3\n4" >> /tmp/myfile
$ echo 5 >> /tmp/myfile

I fixed this by patching line 37

37              #print fh.readline().rstrip()
38              for line in fh.readlines():
39                  print line.rstrip()

petski avatar May 30 '13 09:05 petski