pbortlov / fm-orchestrator

Forked from fm-orchestrator 4 years ago
Clone

67ebe16 Read the files to be hashed as binary to ensure end of lines are not converted

Authored and Committed by mprahl 5 years ago
    Read the files to be hashed as binary to ensure end of lines are not converted
    
    When encoutering a Windows end of line (^M), io.open and open in Python 3
    will convert those to UNIX end of lines by default. When reading logs
    to compute the checksum, it's important those new lines aren't converted,
    to ensure the checksum is correct. This caused issues in Fedora staging
    because when cloning down a repo, the repoSpanner output had Windows end
    of lines, and this would end up in build.log. The solution is to just read
    it as binary so that Python doesn't perform these conversions.