# HG changeset patch # User Shun-ichi GOTO # Date 2007-12-14 15:47:41 # Node ID 165cda754d9e3bb54fed9e3d0038ad64ff24eae8 # Parent c722bd73c948a1b6ed1fc040275aeded061998b1 Workaround for "Not enough space" error due to the bug of Windows. Large write requests fail when stdout is switched to binary mode. As a workaround, limit the data size to write once. diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -919,7 +919,15 @@ if os.name == 'nt': def write(self, s): try: - return self.fp.write(s) + # This is workaround for "Not enough space" error on + # writing large size of data to console. + limit = 16000 + l = len(s) + start = 0 + while start < l: + end = start + limit + self.fp.write(s[start:end]) + start = end except IOError, inst: if inst.errno != 0: raise self.close()