MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _raw_input

Function _raw_input

tools/python-3.11.9-amd64/Lib/getpass.py:129–151  ·  view source on GitHub ↗
(prompt="", stream=None, input=None)

Source from the content-addressed store, hash-verified

127
128
129def _raw_input(prompt="", stream=None, input=None):
130 # This doesn't save the string in the GNU readline history.
131 if not stream:
132 stream = sys.stderr
133 if not input:
134 input = sys.stdin
135 prompt = str(prompt)
136 if prompt:
137 try:
138 stream.write(prompt)
139 except UnicodeEncodeError:
140 # Use replace error handler to get as much as possible printed.
141 prompt = prompt.encode(stream.encoding, 'replace')
142 prompt = prompt.decode(stream.encoding)
143 stream.write(prompt)
144 stream.flush()
145 # NOTE: The Python C API calls flockfile() (and unlock) during readline.
146 line = input.readline()
147 if not line:
148 raise EOFError
149 if line[-1] == '\n':
150 line = line[:-1]
151 return line
152
153
154def getuser():

Callers 2

unix_getpassFunction · 0.85
fallback_getpassFunction · 0.85

Calls 6

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

Tested by

no test coverage detected