pygtail icon indicating copy to clipboard operation
pygtail copied to clipboard

Use "backslashreplace" for encoding errors

Open ryan-shaw opened this issue 1 year ago • 2 comments

When encountering bytes that are not of the expected encoding the file read throws an exception and stops reading completely.

This commit will replace the bytes with an escaped sequence.

More info: https://docs.python.org/3/library/io.html#io.TextIOWrapper

ryan-shaw avatar Jul 01 '23 07:07 ryan-shaw

Good catch. Would it be possible to add a test case for this?

bgreenlee avatar Jul 01 '23 08:07 bgreenlee

Will do

ryan-shaw avatar Jul 01 '23 11:07 ryan-shaw