Skip to content

gh-135683: Ensure that WatchedFileHandler calls handleError on exceptions.#145246

Open
vsajip wants to merge 2 commits into
python:mainfrom
vsajip:fix-135683
Open

gh-135683: Ensure that WatchedFileHandler calls handleError on exceptions.#145246
vsajip wants to merge 2 commits into
python:mainfrom
vsajip:fix-135683

Conversation

@vsajip

@vsajip vsajip commented Feb 26, 2026

Copy link
Copy Markdown
Member

@vsajip vsajip self-assigned this Feb 26, 2026
@vsajip vsajip added the type-bug An unexpected behavior, bug, or error label Feb 26, 2026
@vsajip vsajip added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 28, 2026
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vsajip for commit 33a9869 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F145246%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 28, 2026
@vsajip
vsajip requested a review from picnixz March 9, 2026 14:19
Comment thread Lib/logging/__init__.py
Comment on lines +1260 to +1263
try:
self.stream = self._open()
except Exception:
self.handleError(record)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very silly but I wonder whether a possible AttributeErrorn raised when _open() is missing should be handled or not. Maybe we should only catch the exception when doing:

do_open = self._open
try:
    stream = do_open()
except Exception:
    self.handleError(record)
else:
    self._stream = stream

Or do you think it makes sense to let exceptions happening when setting the field and accessing _open() being handled normally?

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review skip news stale Stale PR or inactive for long period of time. type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants