Patchwork D9661: statichttprepo: explicitly convert error message to str

login
register
mail settings
Submitter phabricator
Date Dec. 28, 2020, 12:31 a.m.
Message ID <differential-rev-PHID-DREV-fcu7dwgf37hzbe4g2krc-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47972/
State Superseded
Headers show

Comments

phabricator - Dec. 28, 2020, 12:31 a.m.
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  For Python 2.7, the implicit conversion of the HTTPError instance to
  str was good enough. For Python 3.x, this fails later when hitting the
  str to bytes conversion logic.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9661

AFFECTED FILES
  mercurial/statichttprepo.py

CHANGE DETAILS




To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -61,7 +61,7 @@ 
             code = f.code
         except urlerr.httperror as inst:
             num = inst.code == 404 and errno.ENOENT or None
-            raise IOError(num, inst)
+            raise IOError(num, str(inst))
         except urlerr.urlerror as inst:
             raise IOError(None, inst.reason)