MCPcopy Index your code
hub / github.com/RustPython/RustPython / _raw_input

Function _raw_input

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

Source from the content-addressed store, hash-verified

160
161
162def _raw_input(prompt="", stream=None, input=None, echo_char=None):
163 # This doesn't save the string in the GNU readline history.
164 if not stream:
165 stream = sys.stderr
166 if not input:
167 input = sys.stdin
168 prompt = str(prompt)
169 if prompt:
170 try:
171 stream.write(prompt)
172 except UnicodeEncodeError:
173 # Use replace error handler to get as much as possible printed.
174 prompt = prompt.encode(stream.encoding, 'replace')
175 prompt = prompt.decode(stream.encoding)
176 stream.write(prompt)
177 stream.flush()
178 # NOTE: The Python C API calls flockfile() (and unlock) during readline.
179 if echo_char:
180 return _readline_with_echo_char(stream, input, echo_char)
181 line = input.readline()
182 if not line:
183 raise EOFError
184 if line[-1] == '\n':
185 line = line[:-1]
186 return line
187
188
189def _readline_with_echo_char(stream, input, echo_char):

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