related to issue #121:
replace os.linsep with "\n" when file file opened in text mode (not
binary)