tuna icon indicating copy to clipboard operation
tuna copied to clipboard

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

Open JoerivanEngelen opened this issue 4 years ago • 3 comments

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

JoerivanEngelen avatar Apr 28 '22 14:04 JoerivanEngelen

I had this same problem, good idea to specify that cmd should be used :)

MEMAndersen avatar Jan 13 '23 14:01 MEMAndersen

Had the same problem. I think it should be specified in the README ;)

Feelx234 avatar Feb 15 '23 17:02 Feelx234

thanks for pointing this out, i was wondering why it's not working until I came here trying to file a bug

andycjw avatar Apr 21 '23 08:04 andycjw