Lineinfile deals heavily with Unic text files. Makes some sense to deal with it all as byte strings. So there is a lot of work done here to show that we're dealing with byte strings throughout.