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

Function _text_encoding

Lib/subprocess.py:367–384  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

365
366
367def _text_encoding():
368 # Return default text encoding and emit EncodingWarning if
369 # sys.flags.warn_default_encoding is true.
370 if sys.flags.warn_default_encoding:
371 f = sys._getframe()
372 filename = f.f_code.co_filename
373 stacklevel = 2
374 while f := f.f_back:
375 if f.f_code.co_filename != filename:
376 break
377 stacklevel += 1
378 warnings.warn("'encoding' argument not specified.",
379 EncodingWarning, stacklevel)
380
381 if sys.flags.utf8_mode:
382 return "utf-8"
383 else:
384 return locale.getencoding()
385
386
387def call(*popenargs, timeout=None, **kwargs):

Callers 1

__init__Method · 0.85

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected