}BFj UdZddlmZddlZddlZddlZddlmZmZddd Z e Z d e d <e fddZ e ZdS)z+ Utilities for dealing with text encodings ) annotationsN)AnyLiteralstreamrdefault str | NonereturncBt|dr|js|S|jS)a)Return the given stream's encoding or a default. There are cases where ``sys.std*`` might not actually be a stream, so check for the encoding attribute prior to returning it, and return a default if it doesn't exist or evaluates as False. ``default`` is None if not provided. encoding)hasattrr )rrs DC:\PYTHON\_runtimes\venv\Lib\site-packages\IPython/utils/encoding.pyget_stream_encrs, 6: & &foobject _sentinel prefer_stream object | boolstrcV|turtjdtdd}d}|rt t j}|r|dkr% tj}n#t$rYnwxYw|pt j }|dkrtjdtd S|S) aReturn IPython's guess for the default encoding for bytes as text. If prefer_stream is True (default), asks for stdin.encoding first, to match the calling Terminal, but that is often None for subprocesses. Then fall back on locale.getpreferredencoding(), which should be a sensible platform default (that respects LANG environment), and finally to sys.getdefaultencoding() which is the most conservative option, and usually UTF8 as of Python 3. zgetpreferredencoding(prefer_stream=) argument is deprecated since IPython 9.0, getdefaultencoding() will take no argument in the future. If you rely on `prefer_stream`, please open an issue on the IPython repo.) stacklevelTNasciicp0zInvalid code page cp0 detected - using cp1252 instead.If cp1252 is incorrect please ensure a valid code page is defined for the process.cp1252) rwarningswarnDeprecationWarningrsysstdinlocalegetpreferredencoding ExceptiongetdefaultencodingRuntimeWarning)rencs r r#r#.sI%%         C(SY'' #.. -//CC    D  )'))C e||  *     x JsA"" A/.A/)N)rrrrr r)rrr r)__doc__ __future__rrr rtypingrrrrr__annotations__r#DEFAULT_ENCODINGrr r,s#"""""      FHH 7@+++++\&%''r