Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/utils/__pycache__/encoding.cpython-39.pyc
Ðазад
a o�h � @ s: d Z ddlZddlZddlZddd�Zd dd�Ze� ZdS ) z+ Utilities for dealing with text encodings � Nc C s t | d�r| js|S | jS dS )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. �encodingN)�hasattrr )�stream�default� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/utils/encoding.py�get_stream_enc s r Tc C sf d}| rt tj�}|r|dkr>zt�� }W n ty< Y n0 |pHt�� }|dkrbt�dt � dS |S )a� Return 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. N�asciiZcp0z�Invalid code page cp0 detected - using cp1252 instead.If cp1252 is incorrect please ensure a valid code page is defined for the process.�cp1252) r �sys�stdin�locale�getpreferredencoding� Exception�getdefaultencoding�warnings�warn�RuntimeWarning)Z prefer_stream�encr r r r &