Skip to content

is this a bug? #9

@allan-avatar1

Description

@allan-avatar1

hey, great util. thanks. i notice that in follow(self,delay=1.0) there is the following code:

            if line[-1] in self.line_terminators:
                line = line[:-1]
                if line[-1:] == '\r\n' and '\r\n' in self.line_terminators:
                    # found crlf
                    line = line[:-1]

but if this is NOT true, then that means we have a line that does not end in a line_terminator. this happens when you've reached the end of a file that you are tailing and the producer of the file is flushing midway through a line.

I would imagine you need to do the following:

            if line[-1] in self.line_terminators:
                line = line[:-1]
                if line[-1:] == '\r\n' and '\r\n' in self.line_terminators:
                    # found crlf
                    line = line[:-1]
            else:
                #Got a partial line
                trailing=True;self.seek(where);time.sleep(delay); continue

*My b if this format is annoying. I'm far too lazy to create pull requests and I have no idea how markdown works. 5min is about all the time I have committed to this bug report. Peace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions