Fix a few remaining Python 3 incompatibilities with JSON payloads.

Review Request #10932 — Created March 2, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

We had a few places in the codebase that were still dealing with JSON
payloads using the wrong string type. json.loads() on Python 3
requires a Unicode string, and won't work with a byte string. We were
using the wrong type in some unit tests and when validating DVCS commit
payloads.

This updates the call sites to encode or decode as necessary in order to
provide json.loads() with Unicode strings.

Unit tests pass on all supported versions of Python.

Summary ID
Fix a few remaining Python 3 incompatibilities with JSON payloads.
We had a few places in the codebase that were still dealing with JSON payloads using the wrong string type. `json.loads()` on Python 3 requires a Unicode string, and won't work with a byte string. We were using the wrong type in some unit tests and when validating DVCS commit payloads. This updates the call sites to encode or decode as necessary in order to provide `json.loads()` with Unicode strings.
6994a03c8134ca9a8709b01f4ef19f60a0ea1f17
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (782ecef)
Loading...