module documentation

Undocumented

Constant APP​_ENGINE Undocumented
Constant CYGWIN Undocumented
Constant MSYS2 Undocumented
Constant WIN Undocumented
Variable binary​_streams Undocumented
Variable text​_streams Undocumented
Class _​Atomic​File Undocumented
Class _​Fixup​Stream The new io interface needs more from streams than streams traditionally implement. As such, this fix-up code is necessary in some circumstances.
Class _​Non​Closing​Text​IOWrapper 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.
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
Variable ​_ansi​_re Undocumented
Variable ​_ansi​_stream​_wrappers Undocumented
Variable ​_default​_text​_stderr Undocumented
Variable ​_default​_text​_stdin Undocumented
Variable ​_default​_text​_stdout Undocumented
APP_ENGINE =

Undocumented

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

Undocumented

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

Undocumented

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

Undocumented

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

Undocumented

text_streams: t.Mapping[str, t.Callable[[t.Optional[str], t.Optional[str]], t.TextIO]] =

Undocumented

def _find_binary_reader(stream):

Undocumented

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

Undocumented

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

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):

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):

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():

Undocumented

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

Undocumented

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

Undocumented

Parameters
stream:t.IOUndocumented
default:boolUndocumented
Returns
boolUndocumented
def _is_compat_stream_attr(stream, attr, value):
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):
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):

Undocumented

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

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):

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):
A stream is misconfigured if its encoding is ASCII.
Parameters
stream:t.TextIOUndocumented
Returns
boolUndocumented
def _wrap_io_open(file, mode, encoding, errors):
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
def auto_wrap_for_ansi(stream, color=None):
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):
Returns the default stream encoding if not found.
Parameters
stream:t.IOUndocumented
Returns
strUndocumented
def get_binary_stderr():

Undocumented

Returns
t.BinaryIOUndocumented
def get_binary_stdin():

Undocumented

Returns
t.BinaryIOUndocumented
def get_binary_stdout():

Undocumented

Returns
t.BinaryIOUndocumented
def get_filesystem_encoding():

Undocumented

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

Undocumented

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

Undocumented

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

Undocumented

Parameters
encoding:t.Optional[str]Undocumented
errors:t.Optional[str]Undocumented
Returns
t.TextIOUndocumented
def is_ascii_encoding(encoding):
Checks if a given encoding is ascii.
Parameters
encoding:strUndocumented
Returns
boolUndocumented
def isatty(stream):

Undocumented

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

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):

Undocumented

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

Undocumented

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

Undocumented

Parameters
x:strUndocumented
Returns
intUndocumented
_ansi_re =

Undocumented

_ansi_stream_wrappers: t.MutableMapping[t.TextIO, t.TextIO] =

Undocumented

_default_text_stderr =

Undocumented

_default_text_stdin =

Undocumented

_default_text_stdout =

Undocumented