{"thread":{"id":"47930","subject":"","startedAt":"2018-02-27T01:18:45Z","lastAt":"2018-02-27T10:26:41Z","messageCount":2,"participants":["Alan Gage","René Scharfe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"340356","messageId":"CAJTBYTnA56peLi4Cb0ZEx1PtOmh8eRF45tQgE=prwF_o7FDMcA@mail.gmail.com","threadId":"47930","inReplyTo":null,"subject":"","fromName":"Alan Gage","fromEmail":"sergeantdestroyersc@gmail.com","sentAt":"2018-02-27T01:18:39Z","receivedAt":"2018-02-27T01:18:45Z","isPatch":false,"sender":{"key":"sergeantdestroyersc@gmail.com","avatar":null},"body":"Hello, I recently noticed a bug involving GitBash and Python. I was\nrunning a function that would post the system time once every second\nusing a while loop but the text was only sent after the while loop\nended due to a timer I had set. Essesntially, instead of it being\nentered every second into the terminal, it was entered all at once,\nwhen the loop ended. I tried this with the Command Line, among other\nthings, and it worked as intended, with the text being entered every\nsecond. This is on Windows 10 Pro with the Fall Creators Update and\nthe most recent version of GitBash.\n"},{"id":"340396","messageId":"d842741d-c079-3222-3655-cdd426ff0516@web.de","threadId":"47930","inReplyTo":"CAJTBYTnA56peLi4Cb0ZEx1PtOmh8eRF45tQgE=prwF_o7FDMcA@mail.gmail.com","subject":"Re:","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2018-02-27T10:26:32Z","receivedAt":"2018-02-27T10:26:41Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 27.02.2018 um 02:18 schrieb Alan Gage:\n> Hello, I recently noticed a bug involving GitBash and Python. I was\n> running a function that would post the system time once every second\n> using a while loop but the text was only sent after the while loop\n> ended due to a timer I had set. Essesntially, instead of it being\n> entered every second into the terminal, it was entered all at once,\n> when the loop ended. I tried this with the Command Line, among other\n> things, and it worked as intended, with the text being entered every\n> second. This is on Windows 10 Pro with the Fall Creators Update and\n> the most recent version of GitBash.\n\nPython buffers its output by default.  On terminals it enables line\nbuffering, i.e. the accumulated output is flushed when a newline\ncharacter is reached.  Otherwise it uses a system-dependent buffer\nsize in the range of a few kilobytes.  You can check if your output\nis a terminal e.g. with:\n\n  python -c \"import sys; print(sys.stdout.isatty())\"\n\nYou can disable buffering by running your script with \"python -u\".\nThis discussion mentions more options:\n\n  https://stackoverflow.com/questions/107705/disable-output-buffering\n\nYou can also start bash on the command line.  I do wonder why Git CMD\nseems to be started in what passes as a terminal, while Git BASH is\nnot, though.\n\nYou may want to check out https://gitforwindows.org/ and report your\nfindings using their issue tracker.\n\n(This mailing list here, git@vger.kernel.org, is mostly used for\ndiscussing Git itself, not so much about extra tools like bash or\nPython that are packaged with Git for Windows.)\n\nRené\n"}]}