From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.1 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id E30FB1F576 for ; Tue, 27 Feb 2018 10:26:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752816AbeB0K0h (ORCPT ); Tue, 27 Feb 2018 05:26:37 -0500 Received: from mout.web.de ([217.72.192.78]:54037 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752090AbeB0K0g (ORCPT ); Tue, 27 Feb 2018 05:26:36 -0500 Received: from [192.168.178.36] ([79.237.251.165]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lw0uH-1eePjw3fYr-017nx4; Tue, 27 Feb 2018 11:26:33 +0100 Subject: Re: To: Alan Gage References: From: =?UTF-8?Q?Ren=c3=a9_Scharfe?= Cc: git@vger.kernel.org Message-ID: Date: Tue, 27 Feb 2018 11:26:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:NiCGMGILSZgC5aIspSEf+SToUaXPLSy6xhwV0rTie3R4P6BS8Qu 695mX/aVx2Rvafacn2MQ0XyfwHoZya1cMIXLCNLYAEZtYDh3sh8YXIdrlIAwfnNX1k8f6hX TrFsrOl4vEKp64WCs6eji2OJVuKwbxrnRzxMBQHcPclFpItNkxif0LEBFPqzekc6B3xFOlm KlIH6Xc2Jg2udGiMQh3vw== X-UI-Out-Filterresults: notjunk:1;V01:K0:pCoGwZm5/3Y=:S3tRZZHjdG7zeIjLEU6uxc GI31zrk+Hn0H4yW7IQRDV8Rk5aBuVquFkDZaFnJzVjTt04hUXhRhLlyehaOZ8jLvv2xJMqwGi Q1YnrNa9czE+N4AgBxG/LFf9cyGdPuvVBhTXiFTcwjBfBZJm5068WJveL1mizzO2GxHfLHyPS avxYZ8mD+21IfNy+ROVZin2jSNg9rlVKu4moyjiGKO81pkpNNE9mDas0+R+8xeAMcI8uaH6h4 Py1oReZLP8QHRqCyYYp0p0+JCahYFR3fhvPqyLRK3phCeAwdPugVk11ShXl3xDBr7WtfeBSdB BZ5dvIlfI6DW0Lt6Q4pnpyLgvCf3w3ABnTfLsRmkPdvAPasIabl8jE67LiAUfmDWSjoBdMA8J Bkg7sR2AFh5v3XWhEfCMjbRccK7l646zmhnqsFKxU3YU0SD+3JzjxLbGMAawhXuGr5P3oLT40 E/Gj3QQro0vDseYVL1NSoaIP+JSJnXVkOS0TGAC94pOkzDLuzNrvI7jrgOOPPWfqXkxJrc2wR GB3/LGsTHXvgkAdEMkAri7X73GWA4TvG7/gErA9c3wZLLp05S+SJSjOYK+18x/luZHGpXmlvp cBA3gYblKnEWxbZCgSEqzkNNf0fOP/Hz4edqKurTf/34ubOv834JwIwd7g20ZmDbauJywvapi cFTMDkvmH5gxbbV6Um15omy3VfQpOyL2ahvNI100HI3Mqmmf27zoPsA1dt1islq1FXc+t7X+X YquIevpoyNUkGAR6/2LS1/ydj6U8WOTnQvMdiYr1HiTsEV0f2uKyjF44EpNbTvYMOVQGdPIvt 0KpGaulbC2RAIJX1FXCo+FLsvDhNw/vWKYY1bP3XWUI1h9Fr9c= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 27.02.2018 um 02:18 schrieb Alan Gage: > Hello, I recently noticed a bug involving GitBash and Python. I was > running a function that would post the system time once every second > using a while loop but the text was only sent after the while loop > ended due to a timer I had set. Essesntially, instead of it being > entered every second into the terminal, it was entered all at once, > when the loop ended. I tried this with the Command Line, among other > things, and it worked as intended, with the text being entered every > second. This is on Windows 10 Pro with the Fall Creators Update and > the most recent version of GitBash. Python buffers its output by default. On terminals it enables line buffering, i.e. the accumulated output is flushed when a newline character is reached. Otherwise it uses a system-dependent buffer size in the range of a few kilobytes. You can check if your output is a terminal e.g. with: python -c "import sys; print(sys.stdout.isatty())" You can disable buffering by running your script with "python -u". This discussion mentions more options: https://stackoverflow.com/questions/107705/disable-output-buffering You can also start bash on the command line. I do wonder why Git CMD seems to be started in what passes as a terminal, while Git BASH is not, though. You may want to check out https://gitforwindows.org/ and report your findings using their issue tracker. (This mailing list here, git@vger.kernel.org, is mostly used for discussing Git itself, not so much about extra tools like bash or Python that are packaged with Git for Windows.) René