Skip to content

Backport(v1.19): in_tail: fix NameError in flush_buffer with emit_unmatched_lines (#5513) - #5516

Merged
Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5513
Oct 4, 2026
Merged

Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5513

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Which issue(s) this PR fixes:
Backport #5513
Fixes #

What this PR does / why we need it:
TailInput#flush_buffer referenced an undefined local variable tail_watcher instead of its argument tw, so it raised NameError: undefined local variable or method 'tail_watcher' when an incomplete buffered line is flushed and the parser returns no record while emit_unmatched_lines is enabled. This can happen with parser plugins which don't implement the unmatched_lines feature, because in_tail only emits the buffered line as unmatched_line in that case.

Add a regression test which flushes a buffered line with such a parser and checks that unmatched_line and path_key are emitted.

Docs Changes:
None

Release Note:
in_tail: fix NameError raised when flushing buffered lines with emit_unmatched_lines true

Assisted-by: LLM Qwen3.8-Flash-Next

**Which issue(s) this PR fixes**:
Fixes #

**What this PR does / why we need it**:
TailInput#flush_buffer referenced an undefined local variable
`tail_watcher` instead of its argument `tw`, so it raised `NameError:
undefined local variable or method 'tail_watcher'` when an incomplete
buffered line is flushed and the parser returns no record while
`emit_unmatched_lines` is enabled. This can happen with parser plugins
which don't implement the `unmatched_lines` feature, because in_tail
only emits the buffered line as `unmatched_line` in that case.

Add a regression test which flushes a buffered line with such a parser
and checks that `unmatched_line` and `path_key` are emitted.

**Docs Changes**:
None

**Release Note**:
in_tail: fix NameError raised when flushing buffered lines with
emit_unmatched_lines true

Assisted-by: LLM Qwen3.8-Flash-Next

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@Watson1978
Watson1978 merged commit c11e2c1 into v1.19 Oct 4, 2026
21 checks passed
@Watson1978
Watson1978 deleted the backport-to-v1.19/pr5513 branch October 4, 2026 09:04
Watson1978 added a commit that referenced this pull request Oct 5, 2026
**Which issue(s) this PR fixes**:
Fixes #

**What this PR does / why we need it**:
The backport task sometimes created PRs without the "Backport #N" line,
e.g. #5516 for #5513. It inserted the line only when the original body
had a trailing space after `**Which issue(s) this PR fixes**:` and CRLF
line endings. This PR accepts the heading without the trailing space and
with LF, and inserts the line once with the body's line ending. It also
removes the invisible trailing spaces from the PR template.

**Docs Changes**:
N/A

**Release Note**:
N/A

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants