MCPcopy Create free account
hub / github.com/ipython/ipython / get_input_encoding

Function get_input_encoding

IPython/core/inputsplitter.py:264–273  ·  view source on GitHub ↗

Return the default standard input encoding. If sys.stdin has no encoding, 'ascii' is returned.

()

Source from the content-addressed store, hash-verified

262
263
264def get_input_encoding():
265 """Return the default standard input encoding.
266
267 If sys.stdin has no encoding, 'ascii' is returned."""
268 # There are strange environments for which sys.stdin.encoding is None. We
269 # ensure that a valid encoding is returned.
270 encoding = getattr(sys.stdin, 'encoding', None)
271 if encoding is None:
272 encoding = 'ascii'
273 return encoding
274
275#-----------------------------------------------------------------------------
276# Classes and functions for normal Python syntax handling

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected