Backport(v1.19): in_tail: fix NameError in flush_buffer with emit_unmatched_lines (#5513) - #5516
Merged
Merged
Conversation
**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
approved these changes
Oct 4, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_watcherinstead of its argumenttw, so it raisedNameError: undefined local variable or method 'tail_watcher'when an incomplete buffered line is flushed and the parser returns no record whileemit_unmatched_linesis enabled. This can happen with parser plugins which don't implement theunmatched_linesfeature, because in_tail only emits the buffered line asunmatched_linein that case.Add a regression test which flushes a buffered line with such a parser and checks that
unmatched_lineandpath_keyare 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