Ensure Unicode arguments for file fetching and bytes for results.

Review Request #10503 — Created April 3, 2019 and submitted

Information

Review Board
release-4.0.x

Reviewers

This adds some type safety for Repository.get_file() and
Repository.get_file_exists(), ensuring that the arguments coming in
are all Unicode strings. It then checks that the results from the
hosting service or SCMTool are bytes. This ensures we're always working
with the data types we're expecting.

This required some fixes in a few of the hosting services and SCMTools,
casting string types for comparisons and for the results.

Unit tests pass on Python 2.7 and 3.7 (with other in-progress changes).

Summary ID
Ensure Unicode arguments for file fetching and bytes for results.
This adds some type safety for `Repository.get_file()` and `Repository.get_file_exists()`, ensuring that the arguments coming in are all Unicode strings. It then checks that the results from the hosting service or SCMTool are bytes. This ensures we're always working with the data types we're expecting. This required some fixes in a few of the hosting services and SCMTools, casting string types for comparisons and for the results.
a1827ab8315fb9dab0ff169f999431d5bb1760c8
Description From Last Updated

F841 local variable 'tool' is assigned to but never used

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (91c3616)