From patchwork Fri Mar 2 20:26:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2561: util: work around Python 3 returning None at EOF instead of '' From: phabricator X-Patchwork-Id: 28720 Message-Id: <8cb09e2a013531c168e223afa5e6d436@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Fri, 2 Mar 2018 20:26:13 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG26a6b62919e2: util: work around Python 3 returning None at EOF instead of '' (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2561?vs=6378&id=6384 REVISION DETAIL https://phab.mercurial-scm.org/D2561 AFFECTED FILES mercurial/util.py CHANGE DETAILS To: durin42, #hg-reviewers, yuja Cc: mercurial-devel diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -729,6 +729,9 @@ def read(self, res, size=-1): if not self.reads: return + # Python 3 can return None from reads at EOF instead of empty strings. + if res is None: + res = '' self.fh.write('%s> read(%d) -> %d' % (self.name, size, len(res))) self._writedata(res)