Clarify that SCMTool.get_file and HostingService.get_file return bytes.

Review Request #4939 — Created Nov. 12, 2013 and submitted

Information

Review Board
master

Reviewers

Clarify that SCMTool.get_file and HostingService.get_file return bytes.

This change goes through and decorates the various get_file calls to make sure
that we're always returning bytes. On Python 2, 'bytes' is just an alias for
'str', but this will be important for Python 3. I've added some assertions in
the tests that handle get_file calls.

This seems to be pretty complete, with the exception that bazaar uses str
concatenation for returning the file. I've added a big XXX comment in there and
a cast to bytes, which at least makes the return types consistent in the event
that the fetched file was able to be stuffed into an str without any errors.

Ran unit tests.

chipx86
  1. Looks fine.

    Just to check, are all unit tests passing with Python 2.6?

  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (a1fe253).