Repository navigation
Preserve falsey supplied loggers and output files - #1345
Open
Quinnod345 wants to merge 1 commit into
Open
Quinnod345 wants to merge 1 commit into
Quinnod345 wants to merge 1 commit into
Conversation
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
reviewed
Nov 7, 2026
Passing a conforming custom logger whose empty record buffer makes it falsey to
H2Configuration(logger=...)silently replaces it withDummyLogger.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:
a90a82dbefore the implementation changes.I maintain Ponder. Its review flagged this case; the regressions reproduce it.