Skip to content

v0.5.1

Choose a tag to compare

@livingstaccato livingstaccato released this 07 Sep 23:31
· 11 commits to main since this release
1ce6f08

Fixed

Test logging no longer raises on a console that cannot encode the message.

The pytest plugin configures structlog as it is imported, before any Foundation
module, so the stream it handed structlog was whatever pytest was holding at
that moment. On Windows that is a cp1252 console behind colorama, and a log
line carrying an emoji raised UnicodeEncodeError out of the logging call and
into the test that triggered it — replacing the real assertion failure with an
encoding error, or failing a test that had otherwise passed.

Because this plugin configures structlog last and is not overridden afterwards,
it decided the outcome regardless of which provide-foundation was installed.
Downstream suites reported byte-identical failure counts against three
different Foundation releases.

Both configure sites now wrap the stream. The replacement is written through
the same text layer rather than the byte layer underneath, so pytest still
captures the output, and backslashreplace names the character (\U0001f40d)
where replace would erase it.