Patchwork [1,of,2] bugzilla: fix reporting of exceptions with py3

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 7, 2020, 9:30 p.m.
Message ID <a141d1da33433998590b.1607376604@xps.local>
Download mbox | patch
Permalink /patch/47819/
State Accepted
Headers show

Comments

Mads Kiilerich - Dec. 7, 2020, 9:30 p.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1607032141 -3600
#      Thu Dec 03 22:49:01 2020 +0100
# Branch stable
# Node ID a141d1da33433998590be226b6788fb53e8c90e0
# Parent  dadbd01f939379a2eea76eab313868fcde48138a
bugzilla: fix reporting of exceptions with py3
Mads Kiilerich - Dec. 7, 2020, 9:42 p.m.
These patches could be considered for stable. They could qualify, as 
they fix some obvious blockers and make the bugzilla extension work 
better with py3.

But there seems to be many other problems with bugzilla extension on 
py3. The extension is messing with internals of xmlrpclib, and the py3 
xmlrpm.client changed a lot. Porting will be a non-trivial development 
effort ... and that require someone who actually use the extension and 
have a test setup.

These changes are a spin-off from 
https://bugzilla.redhat.com/show_bug.cgi?id=1859043 .

/Mads
Yuya Nishihara - Dec. 8, 2020, 10:12 a.m.
On Mon, 07 Dec 2020 22:30:04 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <mads@kiilerich.com>
> # Date 1607032141 -3600
> #      Thu Dec 03 22:49:01 2020 +0100
> # Branch stable
> # Node ID a141d1da33433998590be226b6788fb53e8c90e0
> # Parent  dadbd01f939379a2eea76eab313868fcde48138a
> bugzilla: fix reporting of exceptions with py3

Queued for stable, thanks.

Patch

diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py
--- a/hgext/bugzilla.py
+++ b/hgext/bugzilla.py
@@ -1211,4 +1211,4 @@  def hook(ui, repo, hooktype, node=None, 
                 bz.update(bug, bugs[bug], ctx)
             bz.notify(bugs, stringutil.email(ctx.user()))
     except Exception as e:
-        raise error.Abort(_(b'Bugzilla error: %s') % e)
+        raise error.Abort(_(b'Bugzilla error: %s') % stringutil.forcebytestr(e))