Skip to content

Fix or remove StreamHandler encoding parameter #449

Description

@RazerM

On Python 3, this parameter never did anything due to the following:

https://github.com/getlogbook/logbook/blame/a357032722193f17f4825b67660442eab8fd3527/logbook/handlers.py#L567

where rv is always a str and therefore the if block which encodes strings is never entered.

It's not surprising this wasn't encountered because it's usually used with stdout/stderr which are text streams, or with files opened in text mode via FileHandler.

Clearly tests are missing for binary streams, and care should be taken to check none of the downstream file handlers would be affected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions