Lines Matching refs:stream
3 getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
29 def unix_getpass(prompt='Password: ', stream=None):
33 prompt: Written on stream to ask for the input. Default: 'Password: '
34 stream: A writable file object to display the prompt. Defaults to
53 if not stream:
54 stream = input
62 passwd = fallback_getpass(prompt, stream)
64 if not stream:
65 stream = sys.stderr
77 passwd = _raw_input(prompt, stream, input=input)
80 stream.flush() # issue7208
88 if stream is not input:
91 passwd = fallback_getpass(prompt, stream)
93 stream.write('\n')
97 def win_getpass(prompt='Password: ', stream=None):
100 return fallback_getpass(prompt, stream)
120 def fallback_getpass(prompt='Password: ', stream=None):
123 if not stream:
124 stream = sys.stderr
125 print("Warning: Password input may be echoed.", file=stream)
126 return _raw_input(prompt, stream)
129 def _raw_input(prompt="", stream=None, input=None):
131 if not stream:
132 stream = sys.stderr
138 stream.write(prompt)
141 prompt = prompt.encode(stream.encoding, 'replace')
142 prompt = prompt.decode(stream.encoding)
143 stream.write(prompt)
144 stream.flush()