Fix some string type issues involving hosting service headers.

Review Request #10824 — Created Jan. 14, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

The GitHub implementation was assuming use of byte strings for headers,
as that's what urllib2 wants on Python 2. On Python 3, however, Unicode
strings are used. This means we need to respect the native string type
on both versions.

This change updates the GitHub code to use native string types when
dealing with headers, and updates the tests as well.

It also fixes the type check in HostingServiceHTTPResponse, so that we
catch these problems everywhere.

Unit tests pass on Python 2.x and 3.x.

Summary ID
Fix some string type issues involving hosting service headers.
The GitHub implementation was assuming use of byte strings for headers, as that's what urllib2 wants on Python 2. On Python 3, however, Unicode strings are used. This means we need to respect the native string type on both versions. This change updates the GitHub code to use native string types when dealing with headers, and updates the tests as well. It also fixes the type check in `HostingServiceHTTPResponse`, so that we catch these problems everywhere.
ce4d422302b7703f898b64b739fce2b0fc8e1901
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (7bbf5ac)