Skip to content

Add disclaimer: Tuna cannot deal with captured output of every type of terminal #138

Open
@JoerivanEngelen

Description

Hi,

Thanks for making this very useful package. I was trying to read the output generated with:

python -X importtime import_numpy.py 2> import_numpy.log

I'm working on a Windows machine, and I normally use Powershell. However tuna wasn't able to read the log file written by it.
It threw me the following Warnings for every line in the file:

WARNING:root:Didn't recognize and skipped line import time: 1269 | 18898 | numpy._version
WARNING:root:Didn't recognize and skipped line ``

When I ran the same command in the classic cmd.exe, tuna had no issues reading the captured output.

Apparently Powershell wrote to a file encoded in "UTF-16 LE BOM" and uses CR LF, whereas cmd.exe wrote to a file encoded in UTF-8 and uses Unix style LF.

I don't think tuna should be able to deal with output generated by every kind of terminal, because this is difficult to maintain: Who knows what the developers of some hypothetical superturboshell decide to encode their files to.

But is probably good to add this as a known issue to the documentation.

For reference:

import_numpy_cmd.log
import_numpy_powershell.log

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions