Fix pexpect.FSM for Python 3
Fix logging tests for Python 3
Fix fdpexpect for Python 3
Fix run() for Python 3