This is an archive of the discontinued LLVM Phabricator instance.

[LNT] Python 3 support: fix text/binary confusion in profile support
ClosedPublic

Authored by thopre on Sep 30 2019, 6:56 AM.

Details

Summary

There is confusion between text and binary in the checkFile method of
the various profile format implementation modules. All of them compare
the first few bytes read in text mode against an expected value.
However, the header of the profile v1 contains some binary data, thus
causing an error in Python 3 when reading a profile v1 file and calling
any of the checkFile method.

This commit changes the checkFile method to read binary data and compare
against binary literals.

Diff Detail

Repository
rL LLVM