Currently pywikibot halts if user input is requested but a tty is not present (sys.stdin.isatty() is False) to provide user input.
This occurs often in Travis-CI builds when attempting to login but does not have a password file or the password is invalid. This was partially resolved by https://gerrit.wikimedia.org/r/#/c/214816/
Need to check how to set sys.stdin.isatty() is False during Travis-CI and Appveyor builds. (see also pywikibot/userinterfaces/terminal_interface_win32.py) If there is no tty and a password is needed, the exception should be NoUsername or a subclass to indicate that login failed. (The exception tree for login related errors is badly structured - the top level should be 'LoginFailed' with subclasses for the many reasons why.)