Handle pty linesep difference in Python 3