mu-editor / mu

A small, simple editor for beginner Python programmers. Written in Python and Qt5.
http://codewith.mu
GNU General Public License v3.0
1.41k stars 435 forks source link

Blank line appears in program output #683

Closed tjguk closed 4 years ago

tjguk commented 6 years ago

(This was spotted by a Year 8 group I was teaching who took the trouble to make sure it could be reproduced and in the same place).

Take the code in https://gist.github.com/tjguk/61bd3e38c56fb5e1467381e5a9aa117e and run it in Mu. Between number 57 & 58 a blank line appears. It always appears and it always appears there. If I change the program to run without fizzing or buzzing, no blank line appears. Which leads me to think it's a buffer-length thing.

I've only tried on Win10 / Mu 1.0.1 from the installer

image

tjguk commented 6 years ago

Relevant logs attached though I'm not seeing anything especially useful

mu-logs.txt

tim-mccurrach commented 6 years ago

I'm not 100% sure, I can't run the code cos not with laptop at the moment, but this looks like it might be related to issue #674.

I think that the '\r\n' that's appended to whatever is printing, gets split across the 256 byte chunk in read_std_out and you end up with ... \r and \n... giving two new lines instead of one. I'm nearly done with a pull request to fix this, that I'll probably submit this evening - just got to write tests :)

tjguk commented 6 years ago

Thanks @tim-mccurrach that certainly sounds plausible and along the lines of what I expected. I'll look out for your PR whenever and test it against our code.

carlosperate commented 4 years ago

Looks like #723 has fixed the issue as I am not able to replicate any more :)