xolox / python-coloredlogs

Colored terminal output for Python's logging module
https://coloredlogs.readthedocs.io
MIT License
545 stars 44 forks source link

converter.capture: fix for py3 on darwin by performing ^D check before decoding #74

Closed risicle closed 4 years ago

risicle commented 5 years ago

Without this, py3 on darwin throws the error:

>               if output.startswith(b'^D'):
E               TypeError: startswith first arg must be str or a tuple of str, not bytes

coloredlogs/converter/__init__.py:113: TypeError

and the tests fail as a result of this. Figuring this comparison looks like it should still be done on a bytes level, I just moved the decoding to after this check.

xolox commented 4 years ago

Hi Robert and thanks for this pull request as well as your efforts in NixOS packaging for rotate-backups and dependencies. I've merged your changes and have just released coloredlogs 11.0 which includes these changes. Cheers!