From patchwork Fri Mar 2 13:18:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2536: py3: use util.forcebytestr() to convert IOErrors to bytes From: phabricator X-Patchwork-Id: 28662 Message-Id: <92c9d51368d4aa248eadba5347d27dc0@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Fri, 2 Mar 2018 13:18:36 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG247e9bf4ecdc: py3: use util.forcebytestr() to convert IOErrors to bytes (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2536?vs=6321&id=6326 REVISION DETAIL https://phab.mercurial-scm.org/D2536 AFFECTED FILES hgext/largefiles/remotestore.py CHANGE DETAILS To: pulkit, #hg-reviewers, yuja Cc: mercurial-devel diff --git a/hgext/largefiles/remotestore.py b/hgext/largefiles/remotestore.py --- a/hgext/largefiles/remotestore.py +++ b/hgext/largefiles/remotestore.py @@ -52,23 +52,25 @@ except IOError as e: raise error.Abort( _('remotestore: could not open file %s: %s') - % (filename, str(e))) + % (filename, util.forcebytestr(e))) def _getfile(self, tmpfile, filename, hash): try: chunks = self._get(hash) except urlerr.httperror as e: # 401s get converted to error.Aborts; everything else is fine being # turned into a StoreError - raise basestore.StoreError(filename, hash, self.url, str(e)) + raise basestore.StoreError(filename, hash, self.url, + util.forcebytestr(e)) except urlerr.urlerror as e: # This usually indicates a connection problem, so don't # keep trying with the other files... they will probably # all fail too. raise error.Abort('%s: %s' % (util.hidepassword(self.url), e.reason)) except IOError as e: - raise basestore.StoreError(filename, hash, self.url, str(e)) + raise basestore.StoreError(filename, hash, self.url, + util.forcebytestr(e)) return lfutil.copyandhash(chunks, tmpfile)