MCPcopy Index your code
hub / github.com/python/cpython / _raw_input

Function _raw_input

Lib/getpass.py:213–239  ·  view source on GitHub ↗
(prompt="", stream=None, input=None, echo_char=None,
               term_ctrl_chars=None)

Source from the content-addressed store, hash-verified

211
212
213def _raw_input(prompt="", stream=None, input=None, echo_char=None,
214 term_ctrl_chars=None):
215 # This doesn't save the string in the GNU readline history.
216 if not stream:
217 stream = sys.stderr
218 if not input:
219 input = sys.stdin
220 prompt = str(prompt)
221 if prompt:
222 try:
223 stream.write(prompt)
224 except UnicodeEncodeError:
225 # Use replace error handler to get as much as possible printed.
226 prompt = prompt.encode(stream.encoding, 'replace')
227 prompt = prompt.decode(stream.encoding)
228 stream.write(prompt)
229 stream.flush()
230 # NOTE: The Python C API calls flockfile() (and unlock) during readline.
231 if echo_char:
232 return _readline_with_echo_char(stream, input, echo_char,
233 term_ctrl_chars, prompt)
234 line = input.readline()
235 if not line:
236 raise EOFError
237 if line[-1] == '\n':
238 line = line[:-1]
239 return line
240
241
242def _readline_with_echo_char(stream, input, echo_char, term_ctrl_chars=None,

Callers 2

unix_getpassFunction · 0.85
fallback_getpassFunction · 0.85

Calls 7

strFunction · 0.85
_readline_with_echo_charFunction · 0.85
writeMethod · 0.45
encodeMethod · 0.45
decodeMethod · 0.45
flushMethod · 0.45
readlineMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…