# HG changeset patch # User domruf # Date 1457027048 -3600 # Node ID 7e67883ee3005d111ba3c49719ada6db9acc3d37 # Parent 3f646f7bac3937438f54935a4065f76b32f9e7ba vcs: fix processing of git commands that return output on stderr The subprocessio module used for interfacing with Git is using threading. It might not be fully deterministic. The subprocessio module also had the "feature" that it stopped reading and reported failure once it found output on stderr - even if the command completed (or would complete) with success. Sometimes (like https://drone.io/bitbucket.org/domruf/kallithea/24 ) tests on linux could fail on totally normal informational output like: Couldn't run git command (['git', '-c', 'core.quotepath=false', 'checkout', 'foobranch']). Original error was: Subprocess exited due to an error: Switched to branch 'foobranch' On Windows it would fail even more often. To fix that, ignore stderr while processing output. There is a risk that it in some cases can make the process block on stderr and thus never finish ... but there is no reports of that yet. diff -r 3f646f7bac39 -r 7e67883ee300 kallithea/lib/vcs/subprocessio.py --- a/kallithea/lib/vcs/subprocessio.py Tue Feb 16 22:15:30 2016 +0100 +++ b/kallithea/lib/vcs/subprocessio.py Thu Mar 03 18:44:08 2016 +0100 @@ -355,7 +355,7 @@ starting_values) bg_err = BufferedGenerator(_p.stderr, 16000, 1, bottomless=True) - while not bg_out.done_reading and not bg_out.reading_paused and not bg_err.length: + while not bg_out.done_reading and not bg_out.reading_paused: # doing this until we reach either end of file, or end of buffer. bg_out.data_added_event.wait(1) bg_out.data_added_event.clear()