On Darwin, sys.platform returns byte strings on both python2 and python3. Turn it into a text string everywhere in order to remedy that. Fixes #19845