unable to apply patch: "Type Error: the JSON object must be str, not 'bytes'"
Categories
(Conduit :: moz-phab, defect, P1)
Tracking
(Not tracked)
People
(Reporter: froydnj, Assigned: mhentges)
Details
Attachments
(2 files)
STR:
- Use a git checkout of mozilla-central.
moz-phab patch --apply-to here D39593
ER:
Local tree is updated.
AR:
TypeError: the JSON object must be str, not 'bytes'
| Reporter | ||
Comment 1•5 years ago
|
||
This error also occurs with moz-phab patch --raw D39593, which suggests that the problem is a little deeper than just a single command.
| Assignee | ||
Comment 2•5 years ago
|
||
It's worth trying moz-phab with the --arc flag to use the old phabricator communication logic.
:froydnj how have you set up your git checkout of mozilla-central? Are you using git-cinnabar against https://hg.mozilla.org/mozilla-central?
| Reporter | ||
Comment 3•5 years ago
|
||
(In reply to Mitchell Hentges [:mhentges] from comment #2)
It's worth trying
moz-phabwith the--arcflag to use the old phabricator communication logic.:froydnj how have you set up your git checkout of
mozilla-central? Are you usinggit-cinnabaragainst https://hg.mozilla.org/mozilla-central?
I am using git-cinnabar. The problem seems to be here:
https://github.com/mozilla-conduit/review/blob/master/mozphab/mozphab.py#L721-L722
conn.getresponse() is returning bytes for me, so there needs to be a utf8 decode in there?
| Assignee | ||
Comment 4•5 years ago
|
||
Sounds good - I'd just like to reproduce the issue locally before I submit an official patch :)
I'll give git-cinnabar + D39593 a try
| Assignee | ||
Comment 5•5 years ago
|
||
I'm able to reproduce this with Python 3.5.9.
This couldn't be reproduced on newer versions of Python because json.load(...) changed to support binary strings in Python 3.6.
| Assignee | ||
Comment 6•5 years ago
|
||
Starting in Python 3.6, json.load(...) supports binary input. Prior to this, you have to ensure that you're only feeding it UTF-8 strings, which we haven't been doing here.
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 7•5 years ago
|
||
I'll push out a new version of moz-phab tomorrow
| Assignee | ||
Comment 8•5 years ago
|
||
I landed the original patch without running tests, and we had two failures. This resolves the tests.
| Assignee | ||
Comment 9•5 years ago
|
||
This has been fixed and released in MozPhab 0.1.70 :)
Please re-open if you're still seeing the issue!
Description
•