pybeam.beam_file: fix for python3 (sort strings out of binaries)