phabricator: convert conduit response JSON unicode to bytes inside callconduit
Previously the byte conversion was happening piecemeal in callers, and in the case of createdifferentialrevision not at all, leading to UnicodeEncodeErrors when trying to phabsend a commit with a description containing characters not representable in ascii. (issue6040) Remove all the scattered encoding.unitolocal calls and perform it once, inside callconduit, on the entire response dict recursively before returning it, in keeping with the strategy of converting at the earliest opportunity. Convert all keys used on returned object to bytes. Modify the phabsend tests to test this by adding a € to the commit message of alpha. Differential Revision: https://phab.mercurial-scm.org/D6044
Showing
- hgext/phabricator.py 53 additions, 49 deletionshgext/phabricator.py
- tests/phabricator/phabsend-create-alpha.json 464 additions, 437 deletionstests/phabricator/phabsend-create-alpha.json
- tests/phabricator/phabsend-update-alpha-create-beta.json 771 additions, 661 deletionstests/phabricator/phabsend-update-alpha-create-beta.json
- tests/test-phabricator.t 19 additions, 17 deletionstests/test-phabricator.t
Loading
Please register or sign in to comment