Page MenuHomePhabricator

pywikibot should fail when input is needed but no tty exists
Open, MediumPublic

Description

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.)

Event Timeline

jayvdb raised the priority of this task from to High.
jayvdb updated the task description. (Show Details)
jayvdb added a project: Pywikibot.
jayvdb added subscribers: jayvdb, Multichill.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptJun 1 2015, 5:54 AM
jayvdb renamed this task from pywikibot should fail when input is needed by no tty exists to pywikibot should fail when input is needed but no tty exists.Jul 25 2015, 1:20 PM
jayvdb set Security to None.
jayvdb lowered the priority of this task from High to Medium.Jul 25 2015, 1:29 PM
jayvdb updated the task description. (Show Details)
jayvdb updated the task description. (Show Details)