mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches.
REVISION SUMMARY The write function returns `None` if there was no room to write the given data[1]. I don't like that this is effectively an infinite loop if there's never any progress emptying the underlying buffer, but we're no worse off than before, and it fixes random stacktrace popups seen in the py3 build of TortoiseHg. [1] https://docs.python.org/3/library/io.html#io.RawIOBase.write REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12555 AFFECTED FILES mercurial/utils/procutil.py CHANGE DETAILS diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py +++ b/mercurial/utils/procutil.py @@ -111,7 +111,9 @@ total_to_write = len(s) total_written = 0 while total_written < total_to_write: - total_written += write1(m[total_written:]) + c = write1(m[total_written:]) + if c: + total_written += c return total_written To: mharbison72, #hg-reviewers Cc: mercurial-patches, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel