Skip to content

tail.py can crash when there is unicode in the log #163

@mirober

Description

@mirober

Symptom is that when I click "View Log" the lock screen flashes for a tiny second and then disappears.

This is the traceback:

==== Log: C:\Users\Mike\AppData\Roaming\talon\talon.log ====

Traceback (most recent call last):
  File "pdb.py", line 1704, in main
  File "pdb.py", line 1573, in _runscript
  File "bdb.py", line 580, in run
  File "<string>", line 1, in <module>
  File "c:\program files\talon\tail.py", line 66, in <module>
    tail(sys.argv[1])
  File "c:\program files\talon\tail.py", line 55, in tail
    for line in follow(path):
  File "c:\program files\talon\tail.py", line 16, in follow
    for line in f:
  File "encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 565: character maps to <undefined>
Uncaught exception. Entering post mortem debugging

The character that is causing the issue is this one - right quotation mark - https://www.compart.com/en/unicode/U+201D

Seems strange that it is using 1252 to decode rather than utf-8, but presumably a fairly simple fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions