GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Preserve falsey supplied loggers and output files by Quinnod345 · Pull Request #1345 · python-hyper/h2

Conversation

@Quinnod345

@Quinnod345 Quinnod345 commented Nov 6, 2026

Copy link
Copy Markdown

Passing a conforming custom logger whose empty record buffer makes it falsey to H2Configuration(logger=...) silently replaces it with DummyLogger. OutputLogger(file=...) has the same fallback for a valid falsey writable stream, so its output goes to stderr instead of the selected stream.

Select the defaults only when the argument is None. The new regressions cover an empty logger and a falsey writable stream with trace enabled and disabled. The existing default tests continue to pass.

Validation on CPython 3.13.11/macOS:

  • The three new regressions fail on upstream a90a82d before the implementation changes.
  • All 69 configuration tests and the complete 1,687-test suite pass after the change.
  • The project-required 100% line and branch coverage, source Ruff checks and strict-bytes Mypy checks pass.

I maintain Ponder. Its review flagged this case; the regressions reproduce it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Quinnod345
Preserve falsey supplied loggers and output files
ee1c719
Choose the default logger and output stream only for None. Conforming
objects with an empty record buffer or a false truth value must retain
their identity and receive the requested debug and trace output.

Add regressions for a falsey logger and both trace modes of a falsey
writable stream. All three fail before the repair. The 69 configuration
tests and 1687-test suite pass afterward on CPython3.13.11/macOS, with
100% line and branch coverage, source Ruff and strict-bytes Mypy.
agammann
agammann reviewed Nov 7, 2026
View reviewed changes

@agammann agammann left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Using an explicit is None fallback preserves a caller-supplied logger or output stream even when its truth value is false. The new tests exercise a falsey logger and a falsey file for both trace settings, and check that messages do not fall through to stderr. I reviewed the source and tests; I did not run them locally.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@agammann agammann agammann left review comments
Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Quinnod345 @agammann
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.