Fix TFS client to read in the generated diff as bytes.
Review Request #8561 — Created Dec. 5, 2016 and submitted
The execution of the
diffprogram from the TFS client was reading in the
output as aunicodeobject, which worked a lot of the time, but was causing
problems in a few cases. This manifested itself most often when doing a diff of
a UTF-8 file which contains a BOM. These files are technically well-formed, but
they're rare in practice because UTF-8 has no need for BOMs. Somewhere in
reading in the output, the BOM in the diff was being converted to a series of
three bytes that weren't a UTF-8 BOM, and so trying to apply the patch later
would fail.This also would manifest itself when trying to redirect the output of
rbt diffto a file.
Successfully did a diff of a UTF-8 file containing a BOM and Review Board was
able to apply the patch.
Tool: Pyflakes Processed Files: rbtools/clients/tfs.py Tool: PEP8 Style Checker Processed Files: rbtools/clients/tfs.py