Open Bug 1336147 Opened 8 years ago Updated 8 years ago

raise in rest_request doesn't handle Unicode properly

Categories

(Developer Services :: Mercurial: bzexport, defect)

defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: mccr8, Unassigned)

Details

This code in bzauth.py produces an error message when j['message'] contains unicode: raise Exception('REST error on %s to %s: %s' % ( method, url, j['message'])) Ting-Yu hit this problem when trying to attach a patch with dbaron as a reviewer. dbaron has unicode in his bugzilla name, and is currently not accepting review requests, so there was an error. I found a page on this issue ( http://bugs.python.org/issue2517 ), and it looks like the fix is to explicitly encode the string with Unicode: raise Exception('REST error on %s to %s: %s' % (method, url, unicode(j['message']).encode("utf-8")))
Here's my downstream patch if you want to use it: https://github.com/mozilla/git-bz-moz/commit/ce418c6b48d82cdba97da5098a8d92d4d34c439a (Well, plus a readme change you won't want...)
You need to log in before you can comment on or make changes to this bug.