Patchwork [STABLE] exchange: print full reason variable

login
register
mail settings
Submitter Gregory Szorc
Date May 24, 2017, 10:26 p.m.
Message ID <9d6031df42c834b38489.1495664788@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/20887/
State Accepted
Headers show

Comments

Gregory Szorc - May 24, 2017, 10:26 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1495664724 25200
#      Wed May 24 15:25:24 2017 -0700
# Branch stable
# Node ID 9d6031df42c834b38489d798e4b9b9cc7dd17207
# Parent  f928d53b687cb5738528d2eae97f58da10ca8bae
exchange: print full reason variable

This commit essentially reverts 69ac9aebbc55.

urllib2.URLError receives a "reason" argument. It isn't always a
tuple. Mozilla has experienced at least IndexError failures due
to the reason[1] access.
https://bugzilla.mozilla.org/show_bug.cgi?id=1364687
Yuya Nishihara - May 26, 2017, 2:14 p.m.
On Wed, 24 May 2017 15:26:28 -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1495664724 25200
> #      Wed May 24 15:25:24 2017 -0700
> # Branch stable
> # Node ID 9d6031df42c834b38489d798e4b9b9cc7dd17207
> # Parent  f928d53b687cb5738528d2eae97f58da10ca8bae
> exchange: print full reason variable

Seems fine. Queued, thanks.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -2018,7 +2018,7 @@  def trypullbundlefromurl(ui, repo, url):
             except urlerr.httperror as e:
                 ui.warn(_('HTTP error fetching bundle: %s\n') % str(e))
             except urlerr.urlerror as e:
-                ui.warn(_('error fetching bundle: %s\n') % e.reason[1])
+                ui.warn(_('error fetching bundle: %s\n') % e.reason)
 
             return False
         finally: