Non-ascii chars in a reviewer's "not accepting review requests" breaks bzexport

NEW
Unassigned

Status

Developer Services
Mercurial: bzexport
3 years ago
2 years ago

People

(Reporter: njn, Unassigned)

Tracking

Details

(Reporter)

Description

3 years ago
I was trying to upload some patches to a bug with |hg bzexport| and I kept getting this:

> Traceback (most recent call last):
>   File "/usr/local/bin/hg", line 43, in <module>
>     mercurial.dispatch.run()
>   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 54, in run
>     sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
>   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 116, in dispatch
>     ret = _runcatch(req)
>   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 270, in _runcatch
>     ui.warn(_("abort: %s\n") % inst)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 149: ordinal not in range(128)

I've seen this sort of thing before when requesting review of a reviewer who
has non-ASCII chars in their name. But that wasn't the case this time. So I
was puzzled.

I eventually worked out the problem was the reviewer (heycam) had their "not
accepting review requests" flag set in Bugzilla, with this message:

> Cameron McCormack (:heycam) (away Nov 23 – Dec 4) <cam@mcc.id.au> is not currently accepting 'review' requests. 

The char between the dates is \u2013, a.k.a. EN DASH.

But I only saw that message when I uploaded the patch with requesting review, and then requested review via the Bugzilla UI.

An indication of what the failing text was would have been very helpful. Even
better -- this is 2015, after all -- would be if bzexport could handle
non-ASCII chars :)
FWIW, I hit this bug in late November (also with :heycam's username), and birtles hit it today (with mine, bug 1228229 comment 44).  I think both of us spent a decent amount of time debugging it before realizing what was happening.
You need to log in before you can comment on or make changes to this bug.