aspiers / git-deps

git commit dependency analysis tool
GNU General Public License v2.0
297 stars 46 forks source link

Use unbuffered IO #81

Closed bmwiedemann closed 5 years ago

bmwiedemann commented 5 years ago

Without this patch, git-deps | tee $FILE only produces output in 4KB chunks so when you have to kill the process after a day, you are left with incomplete output.

RonnyPfannschmidt commented 5 years ago

@aspiers unless one flushes, python goes for either line-buffered, or block buffered (one can work around with PYTHONUNBUFFERED for example

a different option would be to use print(..., flush=True)

RonnyPfannschmidt commented 5 years ago

based on https://stackoverflow.com/questions/107705/disable-output-buffering i would consider using flush as the most clean version

aspiers commented 5 years ago

Looks like flush=True is only for Python >= 3.3 so let's go with this for now.