module documentation

Undocumented

Function auto_wrap_for_ansi Support ANSI color and style codes on Windows by wrapping a stream with colorama.
Function get_best_encoding Returns the default stream encoding if not found.
Function get_binary_stderr Undocumented
Function get_binary_stdin Undocumented
Function get_binary_stdout Undocumented
Function get_filesystem_encoding Undocumented
Function get_text_stderr Undocumented
Function get_text_stdin Undocumented
Function get_text_stdout Undocumented
Function is_ascii_encoding Checks if a given encoding is ascii.
Function isatty Undocumented
Function open_stream Undocumented
Function should_strip_ansi Undocumented
Function strip_ansi Undocumented
Function term_len Undocumented
Constant APP_ENGINE Undocumented
Constant CYGWIN Undocumented
Constant MSYS2 Undocumented
Constant WIN Undocumented
Variable binary_streams Undocumented
Variable text_streams Undocumented
Class _AtomicFile Undocumented
Class _FixupStream The new io interface needs more from streams than streams traditionally implement. As such, this fix-up code is necessary in some circumstances.
Class _NonClosingTextIOWrapper Undocumented
Function _find_binary_reader Undocumented
Function _find_binary_writer Undocumented
Function _force_correct_text_reader Undocumented
Function _force_correct_text_stream Undocumented
Function _force_correct_text_writer Undocumented
Function _get_argv_encoding Undocumented
Function _is_binary_reader Undocumented
Function _is_binary_writer Undocumented
Function _is_compat_stream_attr A stream attribute is compatible if it is equal to the desired value or the desired value is unset and the attribute has a value.
Function _is_compatible_text_stream Check if a stream's encoding and errors attributes are compatible with the desired values.
Function _is_jupyter_kernel_output Undocumented
Function _make_cached_stream_func Undocumented
Function _make_text_stream Undocumented
Function _stream_is_misconfigured A stream is misconfigured if its encoding is ASCII.
Function _wrap_io_open Handles not passing ``encoding`` and ``errors`` in binary mode.
Variable _ansi_re Undocumented
Variable _ansi_stream_wrappers Undocumented
Variable _default_text_stderr Undocumented
Variable _default_text_stdin Undocumented
Variable _default_text_stdout Undocumented
def auto_wrap_for_ansi(stream, color=None): (source)

Support ANSI color and style codes on Windows by wrapping a stream with colorama.

Parameters
stream:t.TextIOUndocumented
color:t.Optional[bool]Undocumented
Returns
t.TextIOUndocumented
def get_best_encoding(stream): (source)

Returns the default stream encoding if not found.

Parameters
stream:t.IOUndocumented
Returns
strUndocumented
def get_binary_stderr(): (source)

Undocumented

Returns
t.BinaryIOUndocumented
def get_binary_stdin(): (source)

Undocumented

Returns
t.BinaryIOUndocumented
def get_binary_stdout(): (source)

Undocumented

Returns
t.BinaryIOUndocumented
def get_filesystem_encoding(): (source)

Undocumented

Returns
strUndocumented
def get_text_stderr(encoding=None, errors=None): (source)

Undocumented

Parameters
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
Returns
t.TextIOUndocumented
def get_text_stdin(encoding=None, errors=None): (source)

Undocumented

Parameters
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
Returns
t.TextIOUndocumented
def get_text_stdout(encoding=None, errors=None): (source)

Undocumented

Parameters
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
Returns
t.TextIOUndocumented
def is_ascii_encoding(encoding): (source)

Checks if a given encoding is ascii.

Parameters
encoding:strUndocumented
Returns
boolUndocumented
def isatty(stream): (source)

Undocumented

Parameters
stream:t.IOUndocumented
Returns
boolUndocumented
def open_stream(filename, mode='r', encoding=None, errors='strict', atomic=False): (source)

Undocumented

Parameters
filename:strUndocumented
mode:strUndocumented
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
atomic:boolUndocumented
Returns
t.Tuple[t.IO, bool]Undocumented
def should_strip_ansi(stream=None, color=None): (source)

Undocumented

Parameters
stream:t.Optional[t.IO]Undocumented
color:t.Optional[bool]Undocumented
Returns
boolUndocumented
def strip_ansi(value): (source)

Undocumented

Parameters
value:strUndocumented
Returns
strUndocumented
def term_len(x): (source)

Undocumented

Parameters
x:strUndocumented
Returns
intUndocumented
APP_ENGINE = (source)

Undocumented

Value
('APPENGINE_RUNTIME' in os.environ) and ('Development/' in os.environ.get('SERVE
R_SOFTWARE', ''))
CYGWIN = (source)

Undocumented

Value
sys.platform.startswith('cygwin')
MSYS2 = (source)

Undocumented

Value
sys.platform.startswith('win') and ('GCC' in sys.version)

Undocumented

Value
sys.platform.startswith('win') and not APP_ENGINE and not MSYS2
binary_streams: t.Mapping[str, t.Callable[[], t.BinaryIO]] = (source)

Undocumented

def _find_binary_reader(stream): (source)

Undocumented

Parameters
stream:t.IOUndocumented
Returns
t.Optional[t.BinaryIO]Undocumented
def _find_binary_writer(stream): (source)

Undocumented

Parameters
stream:t.IOUndocumented
Returns
t.Optional[t.BinaryIO]Undocumented
def _force_correct_text_reader(text_reader, encoding, errors, force_readable=False): (source)

Undocumented

Parameters
text_reader:t.IOUndocumented
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
force_readable:boolUndocumented
Returns
t.TextIOUndocumented
def _force_correct_text_stream(text_stream, encoding, errors, is_binary, find_binary, force_readable=False, force_writable=False): (source)

Undocumented

Parameters
text_stream:t.IOUndocumented
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
is_binary:t.Callable[[t.IO, bool], bool]Undocumented
find_binary:t.Callable[[t.IO], t.Optional[t.BinaryIO]]Undocumented
force_readable:boolUndocumented
force_writable:boolUndocumented
Returns
t.TextIOUndocumented
def _force_correct_text_writer(text_writer, encoding, errors, force_writable=False): (source)

Undocumented

Parameters
text_writer:t.IOUndocumented
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
force_writable:boolUndocumented
Returns
t.TextIOUndocumented
def _get_argv_encoding(): (source)

Undocumented

Returns
strUndocumented
def _is_binary_reader(stream, default=False): (source)

Undocumented

Parameters
stream:t.IOUndocumented
default:boolUndocumented
Returns
boolUndocumented
def _is_binary_writer(stream, default=False): (source)

Undocumented

Parameters
stream:t.IOUndocumented
default:boolUndocumented
Returns
boolUndocumented
def _is_compat_stream_attr(stream, attr, value): (source)

A stream attribute is compatible if it is equal to the desired value or the desired value is unset and the attribute has a value.

Parameters
stream:t.TextIOUndocumented
attr:strUndocumented
value:t.Optional[str]Undocumented
Returns
boolUndocumented
def _is_compatible_text_stream(stream, encoding, errors): (source)

Check if a stream's encoding and errors attributes are compatible with the desired values.

Parameters
stream:t.TextIOUndocumented
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
Returns
boolUndocumented
def _is_jupyter_kernel_output(stream): (source)

Undocumented

Parameters
stream:t.IOUndocumented
Returns
boolUndocumented
def _make_cached_stream_func(src_func, wrapper_func): (source)

Undocumented

Parameters
src_func:t.Callable[[], t.TextIO]Undocumented
wrapper_func:t.Callable[[], t.TextIO]Undocumented
Returns
t.Callable[[], t.TextIO]Undocumented
def _make_text_stream(stream, encoding, errors, force_readable=False, force_writable=False): (source)

Undocumented

Parameters
stream:t.BinaryIOUndocumented
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
force_readable:boolUndocumented
force_writable:boolUndocumented
Returns
t.TextIOUndocumented
def _stream_is_misconfigured(stream): (source)

A stream is misconfigured if its encoding is ASCII.

Parameters
stream:t.TextIOUndocumented
Returns
boolUndocumented
def _wrap_io_open(file, mode, encoding, errors): (source)

Handles not passing ``encoding`` and ``errors`` in binary mode.

Parameters
file:t.Union[str, os.PathLike, int]Undocumented
mode:strUndocumented
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
Returns
t.IOUndocumented
_ansi_re = (source)

Undocumented

_ansi_stream_wrappers: t.MutableMapping[t.TextIO, t.TextIO] = (source)

Undocumented

_default_text_stderr = (source)

Undocumented

_default_text_stdin = (source)

Undocumented

_default_text_stdout = (source)

Undocumented