Wolf icon indicating copy to clipboard operation
Wolf copied to clipboard

[bug] nothing appears when printing more than 8190 characters

Open Almenon opened this issue 4 years ago • 1 comments

Works:

print('a'*8190)
# a's show up

Doesn't work:

print('a'*8191)
# a's don't show up

Interestingly the output log for the extension still shows characters, it just doesn't show up inline.

Other relevant info: Python on windows (or at least on my machine) has a buffer size of 8912 bytes so when there's 8193 bytes (8191 a's and a two-byte newline \r\n) there's two flushes. For some reason this breaks wolf. I'm guessing what happens is that wolf receives all the a's, then receives the newline, and writes just the invisible newline to the text decoration, but I'm not sure.

You can check the buffer size by running: python -c "import io;print(io.DEFAULT_BUFFER_SIZE)"

It should also be noted that you are not guaranteed a 'data' event from the process every flush - see https://github.com/nodejs/node/issues/33465

Almenon avatar Nov 28 '20 21:11 Almenon

Thanks! Will check this out today..

Duroktar avatar Nov 28 '20 21:11 Duroktar