Matt Hooks added the comment:
Patch attached.
I'm unsure whether forcing the warning message to stderr is the right choice
here, but it seems unlikely that users would want their warning and password
prompt on the same stream. The alternative here would be a second kwarg, but
that
New submission from Matt Hooks:
When calling getpass.getpass(), certain circumstances cause it to fallback to
getpass.fallback_getpass, such as when swapping out sys.stdin for another
object in a unit test.
In such a circumstance, fallback_getpass may be called with stream=None when
getpass