- On Python 3, decode bytes to str - Tolerate whitespace around the line. - Report a missing HOSTNAME line as an error. - Don't clobber line separators when setting a new hostname. - Add some tests for this strategy to verify correct operation.