%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/__pycache__/_pyio.cpython-312.pyc

�

���f�m��p�dZddlZddlZddlZddlZddlZddlZddlmZ	ejdvrddlmZ
ndZ
ddlZddlmZmZmZmZhd�Zeed�r6ej+ej,�ej+ej.�d	ZeZeed
�xsej4j6ZeZd.d�Ze		d/d��Z d
�Z!	ejDZ"	ejHZ$Gd�dejN��Z(ejPjSe(�Gd�de(�Z*ejTjSe*�ddl+m,Z,e*jSe,�Gd�de(�Z-ejZjSe-�Gd�de-�Z.Gd�de-�Z/Gd�de.�Z0Gd�de.�Z1Gd �d!e-�Z2Gd"�d#e1e0�Z3Gd$�d%e*�Z,Gd&�d'e(�Z4ejhjSe4�Gd(�d)ejj�Z6Gd*�d+e4�Z7Gd,�d-e7�Z8y#e#$re!Z"Y��KwxYw#e#$rGd�de%e&�Z$Y��VwxYw)0z)
Python implementation of the io module.
�N)�
allocate_lock>�win32�cygwin)�setmode)�__all__�SEEK_SET�SEEK_CUR�SEEK_END>r���	SEEK_HOLEi �gettotalrefcountc��|�Wtjjrd}nd}tjjrddl}|jdt|dz�|S)a
    A helper function to choose the text encoding.

    When encoding is not None, this function returns it.
    Otherwise, this function returns the default text encoding
    (i.e. "locale" or "utf-8" depends on UTF-8 mode).

    This function emits an EncodingWarning if *encoding* is None and
    sys.flags.warn_default_encoding is true.

    This can be used in APIs with an encoding=None parameter
    that pass it to TextIOWrapper or open.
    However, please consider using encoding="utf-8" for new APIs.
    N�utf-8�localerz"'encoding' argument not specified.r)�sys�flags�	utf8_mode�warn_default_encoding�warnings�warn�EncodingWarning)�encoding�
stacklevelrs   �/usr/lib/python3.12/_pyio.py�
text_encodingr+sN�����9�9����H��H��9�9�*�*���M�M�>�)�:��>�
;��O�c��t|t�stj|�}t|tt
tf�st
d|z��t|t�st
d|z��t|t�st
d|z��|�t|t�st
d|z��|�t|t�st
d|z��t|�}|td�z
st|�t|�kDrtd|z��d|v}	d	|v}
d
|v}d|v}d|v}
d
|v}d|v}|r
|rtd��|	|
z|z|zdkDrtd��|	s|
s|s
|std��|r
|�td��|r
|�td��|r
|�td��|r |dk(rddl
}|jdtd�t||	xrdxsd|
xrd	xsdz|xrd
xsdz|xrdxsdz|
xrdxsdz||��}|}	d}|dk(s|dkr|j�rd}d}|dkr<t}	tj |j#��j$}|dkDr|}	|dkrtd��|dk(r|r|Std��|
r
t+||�}n0|	s|s|r
t-||�}n|
r
t/||�}ntd |z��|}|r|St1|�}t3|||||�}|}||_|S#t&t(f$rY��wxYw#|j7��xYw)!a�Open file and return a stream.  Raise OSError upon failure.

    file is either a text or byte string giving the name (and the path
    if the file isn't in the current working directory) of the file to
    be opened or an integer file descriptor of the file to be
    wrapped. (If a file descriptor is given, it is closed when the
    returned I/O object is closed, unless closefd is set to False.)

    mode is an optional string that specifies the mode in which the file is
    opened. It defaults to 'r' which means open for reading in text mode. Other
    common values are 'w' for writing (truncating the file if it already
    exists), 'x' for exclusive creation of a new file, and 'a' for appending
    (which on some Unix systems, means that all writes append to the end of the
    file regardless of the current seek position). In text mode, if encoding is
    not specified the encoding used is platform dependent. (For reading and
    writing raw bytes use binary mode and leave encoding unspecified.) The
    available modes are:

    ========= ===============================================================
    Character Meaning
    --------- ---------------------------------------------------------------
    'r'       open for reading (default)
    'w'       open for writing, truncating the file first
    'x'       create a new file and open it for writing
    'a'       open for writing, appending to the end of the file if it exists
    'b'       binary mode
    't'       text mode (default)
    '+'       open a disk file for updating (reading and writing)
    ========= ===============================================================

    The default mode is 'rt' (open for reading text). For binary random
    access, the mode 'w+b' opens and truncates the file to 0 bytes, while
    'r+b' opens the file without truncation. The 'x' mode implies 'w' and
    raises an `FileExistsError` if the file already exists.

    Python distinguishes between files opened in binary and text modes,
    even when the underlying operating system doesn't. Files opened in
    binary mode (appending 'b' to the mode argument) return contents as
    bytes objects without any decoding. In text mode (the default, or when
    't' is appended to the mode argument), the contents of the file are
    returned as strings, the bytes having been first decoded using a
    platform-dependent encoding or using the specified encoding if given.

    buffering is an optional integer used to set the buffering policy.
    Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
    line buffering (only usable in text mode), and an integer > 1 to indicate
    the size of a fixed-size chunk buffer.  When no buffering argument is
    given, the default buffering policy works as follows:

    * Binary files are buffered in fixed-size chunks; the size of the buffer
      is chosen using a heuristic trying to determine the underlying device's
      "block size" and falling back on `io.DEFAULT_BUFFER_SIZE`.
      On many systems, the buffer will typically be 4096 or 8192 bytes long.

    * "Interactive" text files (files for which isatty() returns True)
      use line buffering.  Other text files use the policy described above
      for binary files.

    encoding is the str name of the encoding used to decode or encode the
    file. This should only be used in text mode. The default encoding is
    platform dependent, but any encoding supported by Python can be
    passed.  See the codecs module for the list of supported encodings.

    errors is an optional string that specifies how encoding errors are to
    be handled---this argument should not be used in binary mode. Pass
    'strict' to raise a ValueError exception if there is an encoding error
    (the default of None has the same effect), or pass 'ignore' to ignore
    errors. (Note that ignoring encoding errors can lead to data loss.)
    See the documentation for codecs.register for a list of the permitted
    encoding error strings.

    newline is a string controlling how universal newlines works (it only
    applies to text mode). It can be None, '', '\n', '\r', and '\r\n'.  It works
    as follows:

    * On input, if newline is None, universal newlines mode is
      enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
      these are translated into '\n' before being returned to the
      caller. If it is '', universal newline mode is enabled, but line
      endings are returned to the caller untranslated. If it has any of
      the other legal values, input lines are only terminated by the given
      string, and the line ending is returned to the caller untranslated.

    * On output, if newline is None, any '\n' characters written are
      translated to the system default line separator, os.linesep. If
      newline is '', no translation takes place. If newline is any of the
      other legal values, any '\n' characters written are translated to
      the given string.

    closedfd is a bool. If closefd is False, the underlying file descriptor will
    be kept open when the file is closed. This does not work when a file name is
    given and must be True in that case.

    The newly created file is non-inheritable.

    A custom opener can be used by passing a callable as *opener*. The
    underlying file descriptor for the file object is then obtained by calling
    *opener* with (*file*, *flags*). *opener* must return an open file
    descriptor (passing os.open as *opener* results in functionality similar to
    passing None).

    open() returns a file object whose type depends on the mode, and
    through which the standard file operations such as reading and writing
    are performed. When open() is used to open a file in a text mode ('w',
    'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open
    a file in a binary mode, the returned class varies: in read binary
    mode, it returns a BufferedReader; in write binary and append binary
    modes, it returns a BufferedWriter, and in read/write mode, it returns
    a BufferedRandom.

    It is also possible to use a string or bytearray as a file for both
    reading and writing. For strings StringIO can be used like a file
    opened in a text mode, and for bytes a BytesIO can be used like a file
    opened in a binary mode.
    zinvalid file: %rzinvalid mode: %rzinvalid buffering: %rN�invalid encoding: %r�invalid errors: %rzaxrwb+t�x�r�w�a�+�t�bz'can't have text and binary mode at oncerz)can't have read/write/append mode at oncez/must have exactly one of read/write/append modez-binary mode doesn't take an encoding argumentz+binary mode doesn't take an errors argumentz+binary mode doesn't take a newline argumentrzaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be usedr�)�openerF���Tzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r)�
isinstance�int�os�fspath�str�bytes�	TypeError�set�len�
ValueErrorrr�RuntimeWarning�FileIO�isatty�DEFAULT_BUFFER_SIZE�fstat�fileno�
st_blksize�OSError�AttributeError�BufferedRandom�BufferedWriter�BufferedReaderr�
TextIOWrapper�mode�close)�filerB�	bufferingr�errors�newline�closefdr)�modes�creating�reading�writing�	appending�updating�text�binaryr�raw�result�line_buffering�bs�buffers                      r�openrVLsz��n�d�C� ��y�y�����d�S�%��-�.��*�T�1�2�2��d�C� ��*�T�1�2�2��i��%��/�)�;�<�<���J�x��$=��.��9�:�:�
��*�V�S�"9��,�v�5�6�6���I�E��s�9�~���T��S��Z�!7��+�d�2�3�3��e�|�H��U�l�G��U�l�G��u��I��e�|�H��%�<�D�
�E�\�F����B�C�C��'��G�#�i�/�!�3��D�E�E���7�i��J�K�K�
�(�&��H�I�I�
�&�$��F�G�G�
�'�%��F�G�G�
�)�q�.���
�
�C�$�a�	)����"�s�(�b��/�c�'�R�)��/�c�'�R�)��#��)�r�+��"�s�(�b�	*�
��
)�C��F�&�����>�Y��]�s�z�z�|��I�!�N��q�=�+�I�
#��X�X�c�j�j�l�+�6�6����6� "�I��q�=��5�6�6���>���
��=�>�>��#�C��3�F�
��I�#�C��3�F�
�#�C��3�F��/�$�6�7�7�����M� ��*���V�X�v�w��O������	��
��5�^�,�
��
��6�����
�s=�5+K9�!-K$� K9�/AK9�?$K9�$K6�3K9�5K6�6K9�9Lc�P�ddl}|jdtd�t|d�S)azOpens the provided file with mode ``'rb'``. This function
    should be used when the intent is to treat the contents as
    executable code.

    ``path`` should be an absolute path.

    When supported by the runtime, this function can be hooked
    in order to allow embedders more control over code files.
    This functionality is not supported on the current runtime.
    rNz(_pyio.open_code() may not be using hooksr�rb)rrr5rV)�pathrs  r�_open_code_with_warningrZs(����M�M�<� �!�%���d��rc��eZdZy)�UnsupportedOperationN)�__name__�
__module__�__qualname__�rrr\r\7s��rr\c��eZdZdZd�Zdd�Zd�Zdd�Zd�ZdZ	d	�Z
d
�Zd�Zdd�Z
d
�Zdd�Zd�Zdd�Zed��Zdd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zdd�Zd�Zy)�IOBasea�The abstract base class for all I/O classes.

    This class provides dummy implementations for many methods that
    derived classes can override selectively; the default implementations
    represent a file that cannot be read, written or seeked.

    Even though IOBase does not declare read or write because
    their signatures will vary, implementations and clients should
    consider those methods part of the interface. Also, implementations
    may raise UnsupportedOperation when operations they do not support are
    called.

    The basic type used for binary data read from or written to a file is
    bytes. Other bytes-like objects are accepted as method arguments too.
    Text I/O classes work with str data.

    Note that calling any method (even inquiries) on a closed stream is
    undefined. Implementations may raise OSError in this case.

    IOBase (and its subclasses) support the iterator protocol, meaning
    that an IOBase object can be iterated over yielding the lines in a
    stream.

    IOBase also supports the :keyword:`with` statement. In this example,
    fp is closed after the suite of the with statement is complete:

    with open('spam.txt', 'r') as fp:
        fp.write('Spam and eggs!')
    c�L�t|jj�d|�d���)z@Internal: raise an OSError exception for unsupported operations.�.z() not supported)r\�	__class__r])�self�names  r�_unsupportedzIOBase._unsupported]s&��"�$(�N�N�$;�$;�T�$C�D�	Drc�&�|jd�y)a$Change stream position.

        Change the stream position to byte offset pos. Argument pos is
        interpreted relative to the position indicated by whence.  Values
        for whence are ints:

        * 0 -- start of stream (the default); offset should be zero or positive
        * 1 -- current stream position; offset may be negative
        * 2 -- end of stream; offset is usually negative
        Some operating systems / file systems could provide additional values.

        Return an int indicating the new absolute position.
        �seekN�rh�rf�pos�whences   rrjzIOBase.seekds��	
���&�!rc�&�|jdd�S)z5Return an int indicating the current stream position.rr)rj�rfs r�tellzIOBase.tellts���y�y��A��rNc�&�|jd�y)z�Truncate file to size bytes.

        Size defaults to the current IO position as reported by tell().  Return
        the new size.
        �truncateNrk�rfrms  rrszIOBase.truncatex���	
���*�%rc�$�|j�y)zuFlush write buffers, if applicable.

        This is not implemented for read-only and non-blocking streams.
        N��_checkClosedrps r�flushzIOBase.flush�s��
	
���rFc�f�|js	|j�d|_yy#d|_wxYw)ziFlush and close the IO object.

        This method has no effect if the file is already closed.
        TN)�_IOBase__closedryrps rrCzIOBase.close�s0��
�}�}�
%��
�
�� $��
�	��!%��
�s�'�	0c��	|j}|rytr|j�y	|j�y#t$rYywxYw#YyxYw)zDestructor.  Calls close().N)�closedr=�_IOBASE_EMITS_UNRAISABLErC)rfr}s  r�__del__zIOBase.__del__�sQ��	��[�[�F���#��J�J�L�
��
�
���#�	�
�	��$
��s�:�A	�	A�A�	A
c��y)z�Return a bool indicating whether object supports random access.

        If False, seek(), tell() and truncate() will raise OSError.
        This method may need to do a test seek().
        Fr`rps r�seekablezIOBase.seekable�s��rc�J�|j�st|�d��|��y)zEInternal: raise UnsupportedOperation if file is not seekable
        NzFile or stream is not seekable.)r�r\�rf�msgs  r�_checkSeekablezIOBase._checkSeekable��;���}�}��&�*-�+�(I�@�
@�;>�@�
@�rc��y)zvReturn a bool indicating whether object was opened for reading.

        If False, read() will raise OSError.
        Fr`rps r�readablezIOBase.readable����
rc�J�|j�st|�d��|��y)zEInternal: raise UnsupportedOperation if file is not readable
        NzFile or stream is not readable.)r�r\r�s  r�_checkReadablezIOBase._checkReadable�r�rc��y)z�Return a bool indicating whether object was opened for writing.

        If False, write() and truncate() will raise OSError.
        Fr`rps r�writablezIOBase.writable�r�rc�J�|j�st|�d��|��y)zEInternal: raise UnsupportedOperation if file is not writable
        NzFile or stream is not writable.)r�r\r�s  r�_checkWritablezIOBase._checkWritable�r�rc��|jS)z�closed: bool.  True iff the file has been closed.

        For backwards compatibility, this is a property, not a predicate.
        )r{rps rr}z
IOBase.closed�s���}�}�rc�B�|jrt|�d��|��y)z7Internal: raise a ValueError if file is closed
        N�I/O operation on closed file.�r}r4r�s  rrxzIOBase._checkClosed�s4���;�;�� #��=�6�
6�14�6�
6�rc�&�|j�|S)zCContext management protocol.  Returns self (an instance of IOBase).rwrps r�	__enter__zIOBase.__enter__�s�������rc�$�|j�y)z+Context management protocol.  Calls close()N)rC)rf�argss  r�__exit__zIOBase.__exit__�s���
�
�rc�&�|jd�y)z�Returns underlying file descriptor (an int) if one exists.

        An OSError is raised if the IO object does not use a file descriptor.
        r:Nrkrps rr:z
IOBase.fileno�s��
	
���(�#rc�$�|j�y)z{Return a bool indicating whether this is an 'interactive' stream.

        Return False if it can't be determined.
        Frwrps rr7z
IOBase.isattys��
	
����rc����t�d�r��fd�}nd�}��d�n	�j}|��t	�}�dkst|��kr[�j
|��}|s	t|�S||z
}|jd�r	t|�S�dkr�Lt|��kr�[t|�S#t$rt��d���wxYw)aNRead and return a line of bytes from the stream.

        If size is specified, at most size bytes will be read.
        Size should be an int.

        The line terminator is always b'\n' for binary files; for text
        files, the newlines argument to open can be used to select the line
        terminator(s) recognized.
        �peekc����jd�}|sy|jd�dzxst|�}�dk\rt|��}|S)Nr�
r)r��findr3�min)�	readahead�nrf�sizes  ��r�
nreadaheadz#IOBase.readline.<locals>.nreadaheadsI��� �I�I�a�L�	� ���^�^�E�*�Q�.�A�3�y�>���1�9��A�t��A��rc��y�Nrr`r`rrr�z#IOBase.readline.<locals>.nreadahead!s��rr*� is not an integerrr�)	�hasattr�	__index__r=r1�	bytearrayr3�read�endswithr0)rfr�r��
size_index�resr's``    r�readlinezIOBase.readlines�����4�� �
�
��<��D�
$�!�^�^�
�"�|���k���Q�h�#�c�(�T�/��	�	�*�,�'�A����S�z��
�1�H�C��|�|�E�"���S�z���Q�h�#�c�(�T�/��S�z���"�
?��4�(�*<� =�>�>�
?�s�B5�5C
c�&�|j�|S�Nrwrps r�__iter__zIOBase.__iter__6s�������rc�6�|j�}|st�|Sr�)r��
StopIteration�rf�lines  r�__next__zIOBase.__next__:s���}�}�������rc��|�|dkrt|�Sd}g}|D])}|j|�|t|�z
}||k\s�(|S|S)z�Return a list of lines from the stream.

        hint can be specified to control the number of lines read: no more
        lines will be read if the total size (in bytes/characters) of all
        lines so far exceeds hint.
        r)�list�appendr3)rf�hintr��linesr�s     r�	readlineszIOBase.readlines@sa���<�4�1�9���:��
�����	�D��L�L���
��T��N�A��D�y����	�
�rc�T�|j�|D]}|j|��y)z�Write a list of lines to the stream.

        Line separators are not added, so it is usual for each of the lines
        provided to have a line separator at the end.
        N)rx�write)rfr�r�s   r�
writelineszIOBase.writelinesRs+��	
�����	�D��J�J�t��	r�rr��r*)r]r^r_�__doc__rhrjrqrsryr{rCrr�r�r�r�r�r��propertyr}rxr�r�r:r7r�r�r�r�r�r`rrrbrb;s����@D�"� �&���H�	%��6�@��@��@�����6��
�$��(�T���$rrb)�	metaclassc�*�eZdZdZdd�Zd�Zd�Zd�Zy)�	RawIOBasezBase class for raw binary I/O.c��|�d}|dkr|j�St|j��}|j|�}|�y||d�=t	|�S)z�Read and return up to size bytes, where size is an int.

        Returns an empty bytes object on EOF, or None if the object is
        set not to block and has no data to read.
        Nr*r)�readallr�r��readintor0)rfr�r'r�s    rr�zRawIOBase.readmsZ���<��D��!�8��<�<�>�!��d�n�n�&�'���M�M�!����9��
�a�b�E��Q�x�rc��t�}|jt�x}r||z
}|jt�x}r�|rt|�S|S)z+Read until EOF, using multiple read() call.)r�r�r8r0)rfr��datas   rr�zRawIOBase.readall~sR���k���i�i� 3�4�4�d�4��4�K�C��i�i� 3�4�4�d�4����:���Krc�&�|jd�y)z�Read bytes into a pre-allocated bytes-like object b.

        Returns an int representing the number of bytes read (0 for EOF), or
        None if the object is set not to block and has no data to read.
        r�Nrk�rfr's  rr�zRawIOBase.readinto�rurc�&�|jd�y)z�Write the given buffer to the IO stream.

        Returns the number of bytes written, which may be less than the
        length of b in bytes.
        r�Nrkr�s  rr�zRawIOBase.write�s��	
���'�"rNr�)r]r^r_r�r�r�r�r�r`rrr�r�_s��(��"	�&�#rr�)r6c�>�eZdZdZd
d�Zd
d�Zd�Zd�Zd�Zd�Z	d�Z
y	)�BufferedIOBaseaBase class for buffered IO objects.

    The main difference with RawIOBase is that the read() method
    supports omitting the size argument, and does not have a default
    implementation that defers to readinto().

    In addition, read(), readinto() and write() may raise
    BlockingIOError if the underlying raw stream is in non-blocking
    mode and not ready; unlike their raw counterparts, they will never
    return None.

    A typical implementation should not inherit from a RawIOBase
    implementation, but wrap one.
    c�&�|jd�y)a�Read and return up to size bytes, where size is an int.

        If the argument is omitted, None, or negative, reads and
        returns all data until EOF.

        If the argument is positive, and the underlying raw stream is
        not 'interactive', multiple raw reads may be issued to satisfy
        the byte count (unless EOF is reached first).  But for
        interactive raw streams (XXX and for pipes?), at most one raw
        read will be issued, and a short result does not imply that
        EOF is imminent.

        Returns an empty bytes array on EOF.

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        r�Nrk�rfr�s  rr�zBufferedIOBase.read�s��$	
���&�!rc�&�|jd�y)zaRead up to size bytes with at most one read() system call,
        where size is an int.
        �read1Nrkr�s  rr�zBufferedIOBase.read1�s��	
���'�"rc�(�|j|d��S)afRead bytes into a pre-allocated bytes-like object b.

        Like read(), this may issue multiple reads to the underlying raw
        stream, unless the latter is 'interactive'.

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        F�r���	_readintor�s  rr�zBufferedIOBase.readinto�s���~�~�a�u�~�-�-rc�(�|j|d��S)z�Read bytes into buffer *b*, using at most one system call

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        Tr�r�r�s  r�	readinto1zBufferedIOBase.readinto1�s���~�~�a�t�~�,�,rc���t|t�st|�}|jd�}|r|jt	|��}n|jt	|��}t	|�}||d||S)N�B)r+�
memoryview�castr�r3r�)rfr'r�r�r�s     rr�zBufferedIOBase._readinto�sb���!�Z�(��1�
�A�
�F�F�3�K����:�:�c�!�f�%�D��9�9�S��V�$�D���I����"�1���rc�&�|jd�y)aWrite the given bytes buffer to the IO stream.

        Return the number of bytes written, which is always the length of b
        in bytes.

        Raises BlockingIOError if the buffer is full and the
        underlying raw stream cannot accept more data at the moment.
        r�Nrkr�s  rr�zBufferedIOBase.write�s��	
���'�"rc�&�|jd�y)z�
        Separate the underlying raw stream from the buffer and return it.

        After the raw stream has been detached, the buffer is in an unusable
        state.
        �detachNrkrps rr�zBufferedIOBase.detach����	
���(�#rNr�)r]r^r_r�r�r�r�r�r�r�r�r`rrr�r��s*��
�"�(#�.�	-�
�	#�$rr�c��eZdZdZd�Zdd�Zd�Zdd�Zd�Zd�Z	d	�Z
d
�Zed��Z
ed��Zed
��Zed��Zd�Zd�Zd�Zd�Zy)�_BufferedIOMixinz�A mixin implementation of BufferedIOBase with an underlying raw stream.

    This passes most requests on to the underlying raw stream.  It
    does *not* provide implementations of read(), readinto() or
    write().
    c��||_yr���_raw�rfrQs  r�__init__z_BufferedIOMixin.__init__s	����	rc�^�|jj||�}|dkrtd��|S)Nrz#seek() returned an invalid position)rQrjr<)rfrmrn�new_positions    rrjz_BufferedIOMixin.seeks0���x�x�}�}�S�&�1���!���?�@�@��rc�Z�|jj�}|dkrtd��|S)Nrz#tell() returned an invalid position)rQrqr<rts  rrqz_BufferedIOMixin.tells)���h�h�m�m�o����7��?�@�@��
rNc��|j�|j�|j�|�|j�}|jj|�Sr�)rxr�ryrqrQrsrts  rrsz_BufferedIOMixin.truncate"sL����������
	
�
�
���;��)�)�+�C��x�x� � ��%�%rc�f�|jrtd��|jj�y)N�flush on closed file)r}r4rQryrps rryz_BufferedIOMixin.flush3s#���;�;��3�4�4������rc���|j�9|js,	|j�|jj�yyy#|jj�wxYwr�)rQr}ryrCrps rrCz_BufferedIOMixin.close8sH���8�8�����
!��
�
������� �)4���
����� ���A�A#c�z�|j�td��|j�|j}d|_|S)Nzraw stream already detached)rQr4ryr�r�s  rr�z_BufferedIOMixin.detach@s6���8�8���:�;�;��
�
���i�i����	��
rc�6�|jj�Sr�)rQr�rps rr�z_BufferedIOMixin.seekableJ����x�x� � �"�"rc��|jSr�r�rps rrQz_BufferedIOMixin.rawMs���y�y�rc�.�|jjSr�)rQr}rps rr}z_BufferedIOMixin.closedQs���x�x���rc�.�|jjSr�)rQrgrps rrgz_BufferedIOMixin.nameU����x�x�}�}�rc�.�|jjSr�)rQrBrps rrBz_BufferedIOMixin.modeYr�rc�H�td|jj�d����Nzcannot pickle z object�r1rer]rps r�__getstate__z_BufferedIOMixin.__getstate__]�!���.����)@�)@�(C�7�K�L�Lrc���|jj}|jj}	|j}dj	|||�S#t
$rdj	||�cYSwxYw)Nz<{}.{} name={!r}>z<{}.{}>)rer^r_rg�formatr=)rf�modname�clsnamergs    r�__repr__z_BufferedIOMixin.__repr__`sj���.�.�+�+���.�.�-�-��	F��9�9�D�'�-�-�g�w��E�E���	6��#�#�G�W�5�5�	6�s�A
�
A+�*A+c�6�|jj�Sr�)rQr:rps rr:z_BufferedIOMixin.filenol����x�x��� � rc�6�|jj�Sr�)rQr7rps rr7z_BufferedIOMixin.isattyorrr�r�)r]r^r_r�r�rjrqrsryrCr�r�r�rQr}rgrBr�rr:r7r`rrr�r�s�����
��
&�"�
!��#�����������������M�F�!�!rr�c�~��eZdZdZdZdd�Zd�Zd�Zd�Z�fd�Z	dd�Z
dd	�Zd
�Zdd�Z
d�Zdd
�Zd�Zd�Zd�Z�xZS)�BytesIOz<Buffered I/O implementation using an in-memory bytes buffer.Nc�B�t�}|�||z
}||_d|_y�Nr)r��_buffer�_pos)rf�
initial_bytes�bufs   rr�zBytesIO.__init__{s'���k���$��=� �C������	rc�d�|jrtd��|jj�S)Nz__getstate__ on closed file)r}r4�__dict__�copyrps rr�zBytesIO.__getstate__�s(���;�;��:�;�;��}�}�!�!�#�#rc�Z�|jrtd��t|j�S)z8Return the bytes value (contents) of the buffer
        zgetvalue on closed file)r}r4r0rrps r�getvaluezBytesIO.getvalue�s&���;�;��6�7�7��T�\�\�"�"rc�Z�|jrtd��t|j�S)z;Return a readable and writable view of the buffer.
        zgetbuffer on closed file)r}r4r�rrps r�	getbufferzBytesIO.getbuffer�s&���;�;��7�8�8��$�,�,�'�'rc�n��|j�|jj�t�|�
�yr�)r�clear�superrC�rfres �rrCz
BytesIO.close�s&����<�<�#��L�L��� �
��
�rc��|jrtd��|�d}n	|j}|�}|dkrt|j�}t|j�|jkrytt|j�|j|z�}|j|j|}||_t|�S#t$rt	|�d���wxYw)N�read from closed filer*r�rr)
r}r4r�r=r1r3rr
r�r0)rfr�r��newposr's     rr�zBytesIO.read�s����;�;��4�5�5��<��D�
$�!�^�^�
�"�|���!�8��t�|�|�$�D��t�|�|���	�	�)���S����&��	�	�D�(8�9���L�L����V�,����	��Q�x���"�
?��4�(�*<� =�>�>�
?�s�C�Cc�$�|j|�S)z"This is the same as read.
        )r�r�s  rr�z
BytesIO.read1�s���y�y���rc���|jrtd��t|t�rt	d��t|�5}|j}ddd�dk(ry|j}|t|j�kDr0d|t|j�z
z}|xj|z
c_	||j|||z|xj|z
c_|S#1swY��xYw)N�write to closed file� can't write str to binary streamr�)
r}r4r+r/r1r��nbytesr
r3r)rfr'�viewr�rm�paddings      rr�z
BytesIO.write�s����;�;��3�4�4��a����>�?�?�
��]�	�d����A�	���6���i�i����T�\�\�"�"���s�4�<�<�'8�!8�9�G��L�L�G�#�L�$%����S��q��!��	�	�Q��	���	�	�s�
C�Cc���|jrtd��	|j}|�}|dk(r&|dkrtd|����||_|j
S|dk(r*t
d|j
|z�|_|j
S|dk(r3t
dt|j�|z�|_|j
Std��#t$rt	|�d���wxYw)Nzseek on closed filer�r�negative seek position rrzunsupported whence value)	r}r4r�r=r1r
�maxr3r)rfrmrn�	pos_indexs    rrjzBytesIO.seek�s����;�;��2�3�3�	��
�
�I��+�C��Q�;��Q�w� ��!E�F�F��D�I��y�y��
�q�[��A�t�y�y�3��/�D�I�
�y�y��	�q�[��A�s�4�<�<�0�3�6�7�D�I��y�y���7�8�8���	:��s�g�%7�8�9�9�	:�s�C	�	C!c�H�|jrtd��|jS)N�tell on closed file)r}r4r
rps rrqzBytesIO.tell�s���;�;��2�3�3��y�y�rc���|jrtd��|�
|j}n'	|j}|�}|dkrtd|����|j|d�=|S#t$rt|�d���wxYw)Nztruncate on closed filer�rznegative truncate position )r}r4r
r�r=r1r)rfrmr)s   rrszBytesIO.truncate�s����;�;��6�7�7��;��)�)�C�
"��M�M�	� �k���Q�w� �C�!I�J�J��L�L�����
��"�
>��3�'�);� <�=�=�
>�s�A�A7c�2�|jrtd��y�Nr�Tr�rps rr�zBytesIO.readable�����;�;��<�=�=�rc�2�|jrtd��yr.r�rps rr�zBytesIO.writable�r/rc�2�|jrtd��yr.r�rps rr�zBytesIO.seekable�r/rr�r�r�)r]r^r_r�rr�r�rrrCr�r�r�rjrqrsr�r�r��
__classcell__�res@rr	r	ssS���F��G��$�
#�(��
�*�
�&�*�
�"�
�
rr	c�b�eZdZdZefd�Zd�Zd�Zdd�Zdd�Z	dd�Z
dd	�Zdd
�Zd�Z
d�Zdd
�Zy)r@aBufferedReader(raw[, buffer_size])

    A buffer for a readable, sequential BaseRawIO object.

    The constructor creates a BufferedReader for the given readable raw
    stream and buffer_size. If buffer_size is omitted, DEFAULT_BUFFER_SIZE
    is used.
    c���|j�std��tj||�|dkrt	d��||_|j
�t�|_y)zMCreate a new buffered reader using the given readable raw IO object.
        z "raw" argument must be readable.r�invalid buffer sizeN)	r�r<r�r�r4�buffer_size�_reset_read_buf�Lock�
_read_lock�rfrQr7s   rr�zBufferedReader.__init__
sZ���|�|�~��<�=�=��!�!�$��,��!���2�3�3�&��������&��rc�6�|jj�Sr�)rQr�rps rr�zBufferedReader.readabler�rc� �d|_d|_y)Nrr)�	_read_buf�	_read_posrps rr8zBufferedReader._reset_read_bufs�������rNc��|�|dkrtd��|j5|j|�cddd�S#1swYyxYw)z�Read size bytes.

        Returns exactly size bytes of data unless the underlying raw IO
        stream reaches EOF or if the call would block in non-blocking
        mode. If size is negative, read until EOF or until read() would
        block.
        Nr*zinvalid number of bytes to read)r4r:�_read_unlockedr�s  rr�zBufferedReader.read!sF�����r�	��>�?�?�
�_�_�	-��&�&�t�,�	-�	-�	-�s	�:�Ac�J�d}d}|j}|j}|�|dk(r�|j�t|jd�r-|jj�}|�	||dxsdS||d|zS||dg}d}	|jj
�}||vr|}n |t|�z
}|j|��Adj|�xs|St|�|z
}	||	kr|xj|z
c_||||zS||dg}t|j|�}
|	|krG|jj
|
�}||vr|}n%|	t|�z
}	|j|�|	|kr�Gt||	�}dj|�}||d|_d|_|r|d|S|S)Nr)rNr*r�r)
r>r?r8r�rQr�r�r3r��joinr(r7r�)rfr��
nodata_val�empty_valuesrrm�chunk�chunks�current_size�avail�wanted�outs            rrAzBufferedReader._read_unlocked.s����
�"���n�n���n�n��
�9��R��� � �"��t�x�x��+����(�(�*���=��s�t�9�,��,��s�t�9�u�,�,��#�$�i�[�F��L�����
�
����L�(�!&�J����E�
�*���
�
�e�$���8�8�F�#�1�z�1��C��3�����:��N�N�a��N��s�3�q�5�>�!��c�d�)����T�%�%�q�)���a�i��H�H�M�M�&�)�E���$�"�
���S��Z��E��M�M�%� �
�a�i�
��5�M���h�h�v����Q�R��������s�2�A�w�-�:�-rc��|jd�|j5|j|�cddd�S#1swYyxYw)z�Returns buffered bytes without advancing the position.

        The argument indicates a desired minimal number of bytes; we
        do at most one raw read to satisfy it.  We never return more
        than self.buffer_size.
        zpeek of closed fileN)rxr:�_peek_unlockedr�s  rr�zBufferedReader.peekbs=��	
���/�0�
�_�_�	-��&�&�t�,�	-�	-�	-�s	�9�Ac�`�t||j�}t|j�|jz
}||ks|dkrT|j|z
}|j
j
|�}|r(|j|jd|z|_d|_|j|jdSr)r�r7r3r>r?rQr�)rfr��want�have�to_read�currents      rrMzBufferedReader._peek_unlockedms����1�d�&�&�'���4�>�>�"�T�^�^�3���$�;�$�!�)��&�&��-�G��h�h�m�m�G�,�G��!%�������!@�7�!J���!"����~�~�d�n�n�o�.�.rc	�.�|jd�|dkr|j}|dk(ry|j5|jd�|j	t|t
|j�|jz
��cddd�S#1swYyxYw)z<Reads up to size bytes, with at most one read() system call.zread of closed filerrrN)	rxr7r:rMrAr�r3r>r?r�s  rr�zBufferedReader.read1xs���	
���/�0��!�8��#�#�D��1�9��
�_�_�	A�����"��&�&��D�#�d�n�n�-����>�?�A�	A�	A�	A�s�AB�Bc���|jd�t|t�st|�}|jdk(ry|j	d�}d}|j
5|t
|�kr�tt
|j�|jz
t
|��}|rU|j|j|j|z||||z|xj|z
c_	||z
}|t
|�k(rnlt
|�|z
|jkDr'|jj||d�}|sn0||z
}n|r|s|jd�sn|r|rn|t
|�kr��ddd�|S#1swY|SxYw)z2Read data into *buf* with at most one system call.zreadinto of closed filerr�Nr)rxr+r�r#r�r:r3r�r>r?r7rQr�rM)rfrr��writtenrIr�s      rr�zBufferedReader._readinto�sd��	
���3�4�
�#�z�*��S�/�C��:�:��?���h�h�s�m����
�_�_�	��C��H�$��C����/�$�.�.�@�#�c�(�K������t�~�~�d�n�n�U�6J�K�����
�.��N�N�e�+�N��u�$�G��#�c�(�*���s�8�g�%��(8�(8�8����)�)�#�g�h�-�8�A����q�L�G� �G��.�.�q�1���W��9�C��H�$�	�>��?	�>��s
�DE-�-E7c��ttj|�t|j�z
|j
zd�Sr)r(r�rqr3r>r?rps rrqzBufferedReader.tell�s3���#�(�(��.��T�^�^�1D�D�t�~�~�U�WX�Y�Yrc�4�|tvrtd��|jd�|j5|dk(r%|t	|j
�|jz
z}tj|||�}|j�|cddd�S#1swYyxYw)N�invalid whence valuezseek of closed filer)
�valid_seek_flagsr4rxr:r3r>r?r�rjr8rls   rrjzBufferedReader.seek�s����)�)��3�4�4����/�0�
�_�_�	���{��s�4�>�>�*�T�^�^�;�;��"�'�'��c�6�:�C�� � �"��	�	�	�s�AB�Br�r�r�)r]r^r_r�r8r�r�r8r�rAr�rMr�r�rqrjr`rrr@r@sG���)<�!�#��-�2.�h	-�	/�A�&.�`Z�	rr@c�N�eZdZdZefd�Zd�Zd�Zdd�Zd�Z	d�Z
d	�Zd
d
�Zd�Z
y)r?z�A buffer for a writeable sequential RawIO object.

    The constructor creates a BufferedWriter for the given writeable raw
    stream. If the buffer_size is not given, it defaults to
    DEFAULT_BUFFER_SIZE.
    c���|j�std��tj||�|dkrt	d��||_t
�|_t�|_	y)Nz "raw" argument must be writable.rr6)
r�r<r�r�r4r7r��
_write_bufr9�_write_lockr;s   rr�zBufferedWriter.__init__�sV���|�|�~��<�=�=��!�!�$��,��!���2�3�3�&���#�+����6��rc�6�|jj�Sr�)rQr�rps rr�zBufferedWriter.writable�r�rc�D�t|t�rtd��|j5|jrtd��t
|j�|jkDr|j�t
|j�}|jj|�t
|j�|z
}t
|j�|jkDr	|j�|cddd�S#t$r�}t
|j�|jkDrft
|j�|jz
}||z}|jd|j|_t|j|j|��Yd}~��d}~wwxYw#1swYyxYw)Nr!r )r+r/r1r]r}r4r3r\r7�_flush_unlocked�extend�BlockingIOError�errno�strerror)rfr'�beforerU�e�overages      rr�zBufferedWriter.write�s[���a����>�?�?�
�
�
�	��{�{� �!7�8�8��4�?�?�#�d�&6�&6�6��$�$�&�����)�F��O�O�"�"�1�%��$�/�/�*�V�3�G��4�?�?�#�d�&6�&6�6�	L��(�(�*��/	�	��'�L��4�?�?�+�d�.>�.>�>�#&�d�o�o�"6��9I�9I�"I���7�*��*.�/�/�:K�4�;K�;K�*L���-�a�g�g�q�z�z�7�K�K�
?��L��	�	�s7�B4F�C8�-F�8	F�BF�	F�F�F�FNc���|j5|j�|�|jj�}|jj	|�cddd�S#1swYyxYwr�)r]r`rQrqrsrts  rrszBufferedWriter.truncate�sR��
�
�
�	*�� � �"��{��h�h�m�m�o���8�8�$�$�S�)�		*�	*�	*�s�AA�A'c�f�|j5|j�ddd�y#1swYyxYwr�)r]r`rps rryzBufferedWriter.flushs,��
�
�
�	#�� � �"�	#�	#�	#�s�'�0c��|jrtd��|jr�	|jj	|j�}|�ttjdd��|t|j�kDs|dkrtd��|jd|�=|jr��yy#t
$rt
d��wxYw)Nr�zHself.raw should implement RawIOBase: it should not raise BlockingIOErrorz)write could not complete without blockingrz*write() returned incorrect number of bytes)r}r4r\rQr�rb�RuntimeErrorrc�EAGAINr3r<�rfr�s  rr`zBufferedWriter._flush_unlockeds����;�;��3�4�4��o�o�
G��H�H�N�N�4�?�?�3���y�%��L�L�?��D�D��3�t���'�'�1�q�5��J�K�K�������#��o�o��#�
G�"�$F�G�G�
G�s�%B-�-Cc�X�tj|�t|j�zSr�)r�rqr3r\rps rrqzBufferedWriter.tells!���$�$�T�*�S����-A�A�Arc��|tvrtd��|j5|j�tj|||�cddd�S#1swYyxYw)NrX)rYr4r]r`r�rjrls   rrjzBufferedWriter.seeksS���)�)��3�4�4�
�
�
�	<�� � �"�#�(�(��s�F�;�	<�	<�	<�s�'A�Ac��|j5|j�|jr
	ddd�y	ddd�	|j�|j5|jj	�ddd�y#1swY�JxYw#1swYyxYw#|j5|jj	�ddd�w#1swYwxYwxYwr�)r]rQr}ryrCrps rrCzBufferedWriter.close#s���
�
�
�	��x�x��4�;�;��	�	�#.�	�	!��J�J�L��!�!�
!������ �
!�
!�	�	��
!�
!���!�!�
!������ �
!�
!�
!�s:�A:�B�B�:B�B�
C�C�:	C�C�Cr�r�)r]r^r_r�r8r�r�r�rsryr`rqrjrCr`rrr?r?�s:���)<�	"�#��8*�#�$�"B�<�
!rr?c�r�eZdZdZefd�Zdd�Zd�Zd�Zdd�Z	dd�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zed��Zy)�BufferedRWPaira�A buffered reader and writer object together.

    A buffered reader object and buffered writer object put together to
    form a sequential IO object that can read and write. This is typically
    used with a socket or two-way pipe.

    reader and writer are RawIOBase objects that are readable and
    writeable respectively. If the buffer_size is omitted it defaults to
    DEFAULT_BUFFER_SIZE.
    c��|j�std��|j�std��t||�|_t||�|_y)zEConstructor.

        The arguments are two RawIO instances.
        z#"reader" argument must be readable.z#"writer" argument must be writable.N)r�r<r�r@�readerr?�writer)rfrtrur7s    rr�zBufferedRWPair.__init__CsL��
��� ��?�@�@���� ��?�@�@�$�V�[�9���$�V�[�9��rc�@�|�d}|jj|�S�Nr*)rtr�r�s  rr�zBufferedRWPair.readQs!���<��D��{�{����%�%rc�8�|jj|�Sr�)rtr�r�s  rr�zBufferedRWPair.readintoVs���{�{�#�#�A�&�&rc�8�|jj|�Sr�)rur�r�s  rr�zBufferedRWPair.writeYs���{�{� � ��#�#rc�8�|jj|�Sr�)rtr�r�s  rr�zBufferedRWPair.peek\s���{�{����%�%rc�8�|jj|�Sr�)rtr�r�s  rr�zBufferedRWPair.read1_s���{�{� � ��&�&rc�8�|jj|�Sr�)rtr�r�s  rr�zBufferedRWPair.readinto1bs���{�{�$�$�Q�'�'rc�6�|jj�Sr�)rtr�rps rr�zBufferedRWPair.readablee����{�{�#�#�%�%rc�6�|jj�Sr�)rur�rps rr�zBufferedRWPair.writablehr~rc�6�|jj�Sr�)ruryrps rryzBufferedRWPair.flushks���{�{� � �"�"rc��	|jj�|jj�y#|jj�wxYwr�)rurCrtrps rrCzBufferedRWPair.closens8��	 ��K�K�����K�K�����D�K�K����s	�7�Ac�n�|jj�xs|jj�Sr�)rtr7rurps rr7zBufferedRWPair.isattyts'���{�{�!�!�#�;�t�{�{�'9�'9�';�;rc�.�|jjSr�)rur}rps rr}zBufferedRWPair.closedw����{�{�!�!�!rNr�r�)r]r^r_r�r8r�r�r�r�r�r�r�r�r�ryrCr7r�r}r`rrrrrr3s]��	�4G�:�&�
'�$�&�'�(�&�&�#� �<��"��"rrrc�Z�eZdZdZefd�Zd
d�Zd�Zdd�Zdd�Z	d�Z
d
d	�Zdd
�Zd�Z
d�Zy)r>z�A buffered interface to random access streams.

    The constructor creates a reader and writer for a seekable stream,
    raw, given in the first argument. If the buffer_size is omitted it
    defaults to DEFAULT_BUFFER_SIZE.
    c��|j�tj|||�tj|||�yr�)r�r@r�r?r;s   rr�zBufferedRandom.__init__�s2����������c�;�7�����c�;�7rc���|tvrtd��|j�|jrQ|j5|j
j
|jt|j�z
d�ddd�|j
j
||�}|j5|j�ddd�|dkrtd��|S#1swY�\xYw#1swY�'xYw)NrXrrz seek() returned invalid position)rYr4ryr>r:rQrjr?r3r8r<rls   rrjzBufferedRandom.seek�s����)�)��3�4�4��
�
���>�>����
G����
�
�d�n�n�s�4�>�>�/B�B�A�F�
G��h�h�m�m�C��(��
�_�_�	#�� � �"�	#���7��<�=�=��
�
G�
G��
	#�	#�s�=C�)C �C� C)c�n�|jrtj|�Stj|�Sr�)r\r?rqr@rps rrqzBufferedRandom.tell�s+���?�?�!�&�&�t�,�,�!�&�&�t�,�,rNc�R�|�|j�}tj||�Sr�)rqr?rsrts  rrszBufferedRandom.truncate�s%���;��)�)�+�C��&�&�t�S�1�1rc�V�|�d}|j�tj||�Srw)ryr@r�r�s  rr�zBufferedRandom.read�s(���<��D��
�
���"�"�4��.�.rc�N�|j�tj||�Sr�)ryr@r�r�s  rr�zBufferedRandom.readinto�s���
�
���&�&�t�Q�/�/rc�N�|j�tj||�Sr�)ryr@r�r�s  rr�zBufferedRandom.peek�s���
�
���"�"�4��.�.rc�N�|j�tj||�Sr�)ryr@r�r�s  rr�zBufferedRandom.read1�s���
�
���#�#�D�$�/�/rc�N�|j�tj||�Sr�)ryr@r�r�s  rr�zBufferedRandom.readinto1�s���
�
���'�'��a�0�0rc� �|jra|j5|jj|jt|j�z
d�|j
�ddd�tj||�S#1swY�xYwr�)	r>r:rQrjr?r3r8r?r�r�s  rr�zBufferedRandom.write�sj���>�>����
'����
�
�d�n�n�s�4�>�>�/B�B�A�F��$�$�&�
'��#�#�D�!�,�,�
'�
'�s�A
B�B
r�r�r�)r]r^r_r�r8r�rjrqrsr�r�r�r�r�r�r`rrr>r>|s>���)<�8�
�"-�2�/�0�/�0�1�-rr>c����eZdZdZdZdZdZdZdZdZ	dd�Z
d�Zd�Zd�Z
d	�Zdd
�Zdd�Zd�Zd
�Zd�Zefd�Zd�Zdd�Z�fd�Zd�Zd�Zd�Zd�Zd�Zed��Zed��Z �xZ!S)r6r*FNTc�\�|jdk\r3	|jrtj|j�d|_t	|t
�rt
d��t	|t�r|}|dkr
td��d}t	|t�st
d|����t|�td�kstd|����td�|D��dk7s|jd	�dkDrtd
��d|vr0d|_
d|_tjtj z}nnd
|vr
d|_d}n`d|vr)d|_tj tj$z}n3d|vr/d|_d|_tj(tj z}d	|vrd|_d|_|j"r |jrtj*z}n3|j"rtj,z}ntj.z}|t1tdd�z}t1tdd�xst1tdd�}||z}d}	|dkru|std��|�tj2||d�}n4|||�}t	|t�st
d��|dkrt5d��|}|stj6|d�||_tj8|�}		t;j<|	j>�r<tAtBjDtjFtBjD�|��	t1|	dd�|_%|jJdkrtL|_%tNrtO|tjP�||_)|j&r	tjT|dtV�||_y#d|_wxYw#tH$rY��wxYw#t4$r(}
|
jBtBjXk7r�Yd}
~
�Od}
~
wwxYw#|�tj|��xYw)adOpen a file.  The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
        writing, exclusive creation or appending.  The file will be created if it
        doesn't exist when opened for writing or appending; it will be truncated
        when opened for writing.  A FileExistsError will be raised if it already
        exists when opened for creating. Opening a file for creating implies
        writing so this mode behaves in a similar way to 'w'. Add a '+' to the mode
        to allow simultaneous reading and writing. A custom opener can be used by
        passing a callable as *opener*. The underlying file descriptor for the file
        object is then obtained by calling opener with (*name*, *flags*).
        *opener* must return an open file descriptor (passing os.open as *opener*
        results in functionality similar to passing None).
        rr*z$integer argument expected, got floatznegative file descriptorzinvalid mode: zxrwab+c3�$K�|]}|dv���
y�w)�rwaxNr`)�.0�cs  r�	<genexpr>z"FileIO.__init__.<locals>.<genexpr>�s����)�q�q�F�{�)�s�rr%zKMust have exactly one of create/read/write/append mode and at most one plusr!Tr"r#r$�O_BINARY�O_NOINHERIT�	O_CLOEXECNz'Cannot use closefd=False with file namei�zexpected integer from openerzNegative file descriptorFr;)-�_fd�_closefdr-rCr+�floatr1r,r4r/r2�sum�count�_created�	_writable�O_EXCL�O_CREAT�	_readable�O_TRUNC�
_appending�O_APPEND�O_RDWR�O_RDONLY�O_WRONLY�getattrrVr<�set_inheritabler9�stat�S_ISDIR�st_mode�IsADirectoryErrorrc�EISDIRrdr=�_blksizer8�_setmoder�rg�lseekr
�ESPIPE)rfrDrBrHr)�fdr�noinherit_flag�owned_fd�fdfstatrfs           rr�zFileIO.__init__�s����8�8�q�=�
��=�=��H�H�T�X�X�&�����d�E�"��B�C�C��d�C� ��B��A�v� �!;�<�<��B��$��$��$�8�9�9��4�y�C��M�)��4�9�:�:��)�D�)�)�Q�.�$�*�*�S�/�A�2E��9�:�
:��$�;� �D�M�!�D�N��I�I��
�
�*�E�
�D�[�!�D�N��E�
�D�[�!�D�N��J�J����+�E�
�D�[�!�D�N�"�D�O��K�K�"�*�*�,�E��$�;�!�D�N�!�D�N��>�>�d�n�n��R�Y�Y��E�
�^�^��R�[�[� �E��R�[�[� �E�
���Z��+�+��!�"�m�Q�7�6�!�"�k�1�5�	�
������/	��A�v��$�%N�O�O��>�����u�e�4�B���e�,�B�%�b�#�.�'�(F�G�G��A�v�%�&@�A�A���%��&�&�r�5�1�#�D�M��h�h�r�l�G�
��<�<����0�+�E�L�L�,.�K�K����,E�t�M�M�1�$�G�\�1�=�D�M��}�}��!� 3��
����R�[�[�)��D�I������H�H�R��H�-�����I����T"�
��
��&���w�w�%�,�,�.��/����	��#�����"��sb�+O�BP�#AO�>A P�O�	O�	O�P�O�P�	P�&P	�P�	P�P�P+c��|jdk\rK|jr>|js1ddl}|j	d|��t
d|��|j
�yyyy)Nrzunclosed file r)r�source)r�r�r}rr�ResourceWarningrC)rfrs  rrzFileIO.__del__HsK���8�8�q�=�T�]�]�4�;�;���M�M��6��%&�t�
�
5��J�J�L�	4?�]�=rc�H�td|jj�d���r�r�rps rr�zFileIO.__getstate__Or�rc	�N�|jj�d|jj��}|jrd|zS	|j}d|�d|�d|j
�d|j�d�	S#t$r*d||j|j
|jfzcYSwxYw)	Nrdz
<%s [closed]>�<z name=z mode=z	 closefd=�>z<%s fd=%d mode=%r closefd=%r>)	rer^r_r}rgrBr�r=r�)rf�
class_namergs   rrzFileIO.__repr__Rs��� $��� 9� 9� $��� ;� ;�=�
��;�;�"�Z�/�/�	B��9�9�D� ��t�y�y�$�-�-�A�
B��	�	F�3�����4�9�9�d�m�m�D�E�
F�	F�s�A1�10B$�#B$c�2�|jstd��y)NzFile not open for reading)r�r\rps rr�zFileIO._checkReadable`����~�~�&�'B�C�C�rc�2�|jstd��y)NzFile not open for writing)r�r\r�s  rr�zFileIO._checkWritabledr�rc���|j�|j�|�|dkr|j�S	tj|j
|�S#t$rYywxYw)z�Read at most size bytes, returned as bytes.

        Only makes one system call, so less data may be returned than requested
        In non-blocking mode, returns None if no data is available.
        Return an empty bytes object at EOF.
        Nr)rxr�r�r-r�r�rbr�s  rr�zFileIO.readhs_��	
���������<�4�!�8��<�<�>�!�	��7�7�4�8�8�T�*�*���	��	�s�A�	A%�$A%c�R�|j�|j�t}	tj|j
dt�}tj|j
�j}||k\r||z
dz}t�}	t|�|k\rt|�}|t|t�z
}|t|�z
}	tj|j
|�}|s	t|�S||z
}�o#t$rY��wxYw#t$r|rYt|�SYywxYw)z�Read all data from the file, returned as bytes.

        In non-blocking mode, returns as much as is immediately available,
        or None if no data is available.  Return an empty bytes object at EOF.
        rrN)rxr�r8r-r�r�r	r9�st_sizer<r�r3r(r�rbr0)rf�bufsizerm�endrRr�rFs       rr�zFileIO.readallxs!��	
��������%��	��(�(�4�8�8�Q��1�C��(�(�4�8�8�$�,�,�C��c�z���)�a�-�������6�{�g�%��f�+���3�w�(;�<�<���#�f�+�%�A�
�������!�,��
���V�}��
�e�O�F���	�	��	��#�
����V�}���
�s$�AC=�	 D�=	D	�D	�D&�%D&c��t|�jd�}|jt|��}t|�}||d||S)zSame as RawIOBase.readinto().r�N)r�r�r�r3)rfr'�mr�r�s     rr�zFileIO.readinto�sA���q�M���s�#���y�y��Q�� ����I����"�1���rc��|j�|j�	tj|j|�S#t
$rYywxYw)aWrite bytes b to file, return number written.

        Only makes one system call, so not all of the data may be written.
        The number of bytes actually written is returned.  In non-blocking mode,
        returns None if the write would block.
        N)rxr�r-r�r�rbr�s  rr�zFileIO.write�sH��	
��������	��8�8�D�H�H�a�(�(���	��	�s�A�	A�
Ac��t|t�rtd��|j�t	j
|j||�S)a�Move to new file position.

        Argument offset is a byte count.  Optional argument whence defaults to
        SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
        are SEEK_CUR or 1 (move relative to current position, positive or negative),
        and SEEK_END or 2 (move relative to end of file, usually negative, although
        many platforms allow seeking beyond the end of a file).

        Note that not all file objects are seekable.
        zan integer is required)r+r�r1rxr-r�r�rls   rrjzFileIO.seek�s=���c�5�!��4�5�5������x�x����#�v�.�.rc�l�|j�tj|jdt�S)zYtell() -> int.  Current file position.

        Can raise OSError for non seekable files.r)rxr-r�r�r	rps rrqzFileIO.tell�s'��	
�����x�x����!�X�.�.rc��|j�|j�|�|j�}tj|j
|�|S)z�Truncate the file to at most size bytes.

        Size defaults to the current file position, as returned by tell().
        The current file position is changed to the value of size.
        )rxr�rqr-�	ftruncater�r�s  rrszFileIO.truncate�sC��	
���������<��9�9�;�D�
���T�X�X�t�$��rc���|js;	|jrtj|j�t
�|�
�yy#t
�|�
�wxYw)z�Close the file.

        A closed file cannot be used for further I/O operations.  close() may be
        called more than once without error.
        N)r}r�r-rCr�rrs �rrCzFileIO.close�sC����{�{�
 ��=�=��H�H�T�X�X�&���
����
��
��s�+A
�
Ac���|j�|j�$	|j�d|_|jS|jS#t$rd|_Y|jSwxYw)z$True if file supports random-access.TF)rx�	_seekablerqr<rps rr�zFileIO.seekable�sf�������>�>�!�
&��	�	��"&����~�~��t�~�~���	�
'�!&����~�~��	
'�s�A
�
A+�*A+c�:�|j�|jS)z'True if file was opened in a read mode.)rxr�rps rr�zFileIO.readable���������~�~�rc�:�|j�|jS)z(True if file was opened in a write mode.)rxr�rps rr�zFileIO.writable�r�rc�:�|j�|jS)z3Return the underlying file descriptor (an integer).)rxr�rps rr:z
FileIO.fileno�s�������x�x�rc�`�|j�tj|j�S)z.True if the file is connected to a TTY device.)rxr-r7r�rps rr7z
FileIO.isatty�s!�������y�y����"�"rc��|jS)z6True if the file descriptor will be closed by close().)r�rps rrHzFileIO.closefds���}�}�rc��|jr|jryy|jr|jryy|jr|jryyy)zString giving the file modezxb+�xbzab+�abzrb+rX�wb)r�r�r�r�rps rrBzFileIO.modesC���=�=��~�~���
�_�_��~�~���
�^�^��~�~���r)r"TNr�)"r]r^r_r�r�r�r�r�r�r�r�rr�rr�r�r�r�r�r�rrjrqrsrCr�r�r�r:r7r�rHrBr2r3s@rr6r6�s����
�C��H��I��I��J��I��H�w�r�M�B�D�D�� !�F�� (�/� /�� �
��
�
�
#�
�������rr6c�b�eZdZdZdd�Zd�Zdd�Zd�Zd�Ze	d��Z
e	d	��Ze	d
��Zy)
�
TextIOBaseznBase class for text I/O.

    This class provides a character and line based interface to stream
    I/O.
    c�&�|jd�y)z�Read at most size characters from stream, where size is an int.

        Read from underlying buffer until we have size characters or we hit EOF.
        If size is negative or omitted, read until EOF.

        Returns a string.
        r�Nrkr�s  rr�zTextIOBase.read%s��	
���&�!rc�&�|jd�y)z.Write string s to stream and returning an int.r�Nrk)rf�ss  rr�zTextIOBase.write/s�����'�"rNc�&�|jd�y)z*Truncate size to pos, where pos is an int.rsNrkrts  rrszTextIOBase.truncate3s�����*�%rc�&�|jd�y)z_Read until newline or EOF.

        Returns an empty string if EOF is hit immediately.
        r�Nrkrps rr�zTextIOBase.readline7s��
	
���*�%rc�&�|jd�y)z�
        Separate the underlying buffer from the TextIOBase and return it.

        After the underlying buffer has been detached, the TextIO is in an
        unusable state.
        r�Nrkrps rr�zTextIOBase.detach>r�rc��y)zSubclasses should override.Nr`rps rrzTextIOBase.encodingGs��rc��y)z�Line endings translated so far.

        Only line endings translated during reading are considered.

        Subclasses should override.
        Nr`rps r�newlineszTextIOBase.newlinesLs��rc��y)zMError setting of the decoder or encoder.

        Subclasses should override.Nr`rps rrFzTextIOBase.errorsVs��
rr�r�)
r]r^r_r�r�r�rsr�r�r�rr�rFr`rrr�r�s\���"�#�&�&�$������������rr�c�N�eZdZdZdd�Zd
d�Zd�Zd�Zd�ZdZ	dZ
d	Zed
��Z
y)�IncrementalNewlineDecodera+Codec used when reading a file in universal newlines mode.  It wraps
    another incremental decoder, translating \r\n and \r into \n.  It also
    records the types of newlines encountered.  When used with
    translate=False, it ensures that the newline sequence is returned in
    one piece.
    c�~�tjj||��||_||_d|_d|_y)N)rFrF)�codecs�IncrementalDecoderr��	translate�decoder�seennl�	pendingcr)rfr�r�rFs    rr�z"IncrementalNewlineDecoder.__init__gs7���!�!�*�*�4��*�?�"�����������rc�8�|j�|}n|jj||��}|jr|s|rd|z}d|_|jd�r|s|dd}d|_|j	d�}|j	d�|z
}|j	d�|z
}|xj
|xr|j|xr|jz|xr|jzzc_|jr(|r|jdd�}|r|jdd�}|S)N��final�
Fr*T�
�
)r��decoder�r�r�r��_LF�_CR�_CRLFr��replace)rf�inputr��output�crlf�cr�lfs       rr�z IncrementalNewlineDecoder.decodens���<�<���F��\�\�(�(��e�(�<�F��>�>�v���F�]�F�"�D�N��?�?�4� ���C�R�[�F�!�D�N��|�|�F�#��
�\�\�$�
�$�
&��
�\�\�$�
�$�
&�������t�x�x�B�O�4�8�8�<��*��
�
�,�	,���>�>�������5�������d�3���
rc��|j�d}d}n|jj�\}}|dz}|jr|dz}||fS)Nrrr)r��getstater�)rfr�flags   rrz"IncrementalNewlineDecoder.getstate�sO���<�<���C��D����-�-�/�I�C����
���>�>��A�I�D��D�y�rc��|\}}t|dz�|_|j�!|jj||dz	f�yyr�)�boolr�r��setstate)rf�staterrs    rrz"IncrementalNewlineDecoder.setstate�sD���	��T��d�Q�h�����<�<�#��L�L�!�!�3���	�"2�3�$rc�n�d|_d|_|j�|jj�yy)NrF)r�r�r��resetrps rr
zIncrementalNewlineDecoder.reset�s/���������<�<�#��L�L��� �$rrr�c� �d|jS)N)Nr�r�)r�r�r�)r�r�)r�r�)r�r�r�)r�rps rr�z"IncrementalNewlineDecoder.newlines�s�������	rN)�strict)F)r]r^r_r�r�r�rrr
r�r�r�r�r�r`rrr�r�`sC�����>	�4�!��C�
�C�
�E�
�	��	rr�c�p�eZdZdZdZdZ		d*d�Zd�Z		d*d�Zd�Z	e
d��Ze
d	��Ze
d
��Z
e
d��Ze
d��Zddeddd
�d�Zd�Zd�Zd�Zd�Zd�Ze
d��Ze
d��Zd�Zd�Zd�Zd�Zd�Zd�Zd+d�Zd�Z d�Z!d�Z"		d,d �Z#d!�Z$d"�Z%d+d#�Z&d$�Z'd-d%�Z(d+d&�Z)d'�Z*d+d(�Z+e
d)��Z,y).rAa�Character and line based layer over a BufferedIOBase object, buffer.

    encoding gives the name of the encoding that the stream will be
    decoded or encoded with. It defaults to locale.getencoding().

    errors determines the strictness of encoding and decoding (see the
    codecs.register) and defaults to "strict".

    newline can be None, '', '\n', '\r', or '\r\n'.  It controls the
    handling of line endings. If it is None, universal newlines is
    enabled.  With this enabled, on input, the lines endings '\n', '\r',
    or '\r\n' are translated to '\n' before being returned to the
    caller. Conversely, on output, '\n' is translated to the system
    default line separator, os.linesep. If newline is any other of its
    legal values, that newline becomes the newline when the file is read
    and it is returned untranslated. On output, '\n' is converted to the
    newline.

    If line_buffering is True, a call to flush is implied when a call to
    write contains a newline character.
    iNc�`�|j|�t|�}|dk(r|j�}t|t�std|z��t
j|�jsd}t||z��|�d}n9t|t�std|z��trt
j|�||_d|_
d|_d|_|j j#�x|_|_t)|j d�|_|j-|||||�y)	NrrzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsr
r r(rr�)�_check_newliner�_get_locale_encodingr+r/r4r��lookup�_is_text_encoding�LookupError�
_CHECK_ERRORS�lookup_errorr�_decoded_chars�_decoded_chars_used�	_snapshotrUr�r��_tellingr��
_has_read1�
_configure)rfrUrrFrGrS�
write_throughr�s        rr�zTextIOWrapper.__init__�s�����G�$� ��*���x���0�0�2�H��(�C�(��3�h�>�?�?��}�}�X�&�8�8�B�C��c�H�n�-�-��>��F��f�c�*� �!5��!>�?�?���#�#�F�+���� ���#$�� ����)-���)=�)=�)?�?�����!�$�+�+�w�7�������&�'�&�
�	7rc�z�|�'t|t�stdt|�����|dvrt	d|����y)Nzillegal newline type: )Nr(r�r�r�zillegal newline value: )r+r/r1�typer4)rfrGs  rrzTextIOWrapper._check_newline�s?����z�'�3�'?��$�w�-�I�J�J��8�8��G�E�F�F�9rc��||_||_d|_d|_d|_||_|du|_||_|dk7|_|xstj|_||_||_
|jrR|j�rA|j j#�}|dk7r!	|j%�j'd�yyyy#t($rYywxYw)N�r(r)�	_encoding�_errors�_encoder�_decoder�	_b2cratio�_readuniversal�_readtranslate�_readnl�_writetranslater-�linesep�_writenl�_line_buffering�_write_throughr�r�rUrq�_get_encoderrr)rfrrFrGrSr�positions       rrzTextIOWrapper._configure�s���!��������
���
����")�k���%��o������&�"�}����-�2�:�:��
�-���+����>�>�d�m�m�o��{�{�'�'�)�H��1�}���%�%�'�0�0��3��.�>��
#����s�)C�	C�Cc�r�dj|jj|jj�}	|j}|dj|�z
}	|j}|dj|�z
}|dj|j�zS#t
$rY�JwxYw#t
$rY�8wxYw)Nz<{}.{}z name={0!r}z mode={0!r}z encoding={0!r}>)rrer^r_rgr=rBr)rfrRrgrBs    rrzTextIOWrapper.__repr__!s���������!:�!:�!%���!<�!<�>��	1��9�9�D�
�m�*�*�4�0�0�F�	1��9�9�D�
�m�*�*�4�0�0�F��*�1�1�$�-�-�@�@�@���	��	���	��	�s#�B�B*�	B'�&B'�*	B6�5B6c��|jSr�)r"rps rrzTextIOWrapper.encoding2s���~�~�rc��|jSr�)r#rps rrFzTextIOWrapper.errors6����|�|�rc��|jSr�)r-rps rrSzTextIOWrapper.line_buffering:s���#�#�#rc��|jSr�)r.rps rrzTextIOWrapper.write_through>s���"�"�"rc��|jSr�)rrps rrUzTextIOWrapper.bufferBr4r)rrFrGrSrc��|j�|�
|�|turtd��|�|�
|j}n!d}nt	|t
�st
d|z��|�
|j}n3t	|t
�st
d|z��|dk(r|j�}|tur|j}|j|�|�|j}|�|j}|j�|j|||||�y)z`Reconfigure the text stream with new parameters.

        This also flushes the stream.
        NzPIt is not possible to set the encoding or newline of stream after the first readr
r rr)r%�Ellipsisr\r#r+r/r1r"rr)rrSrryr)rfrrFrGrSrs      r�reconfigurezTextIOWrapper.reconfigureFs
��
�M�M�%��)�V�-?��x�/�&�'�(�
(��>�������!���F�C�(��0�6�9�:�:����~�~�H��h��,�� 6�� A�B�B��8�#��4�4�6���h���l�l�G����G�$��!�!�0�0�N�� � �.�.�M��
�
������&�'�&�
�	7rc�H�|jrtd��|jS)Nr�)r}r4r�rps rr�zTextIOWrapper.seekableqs���;�;��<�=�=��~�~�rc�6�|jj�Sr�)rUr�rps rr�zTextIOWrapper.readablevr~rc�6�|jj�Sr�)rUr�rps rr�zTextIOWrapper.writableyr~rc�Z�|jj�|j|_yr�)rUryr�rrps rryzTextIOWrapper.flush|s������������
rc���|j�9|js,	|j�|jj�yyy#|jj�wxYwr�)rUr}ryrCrps rrCzTextIOWrapper.close�sL���;�;�"�4�;�;�
$��
�
�����!�!�#�	,7�"�����!�!�#�r�c�.�|jjSr�)rUr}rps rr}zTextIOWrapper.closed�r�rc�.�|jjSr�)rUrgrps rrgzTextIOWrapper.name�s���{�{���rc�6�|jj�Sr�)rUr:rps rr:zTextIOWrapper.fileno�����{�{�!�!�#�#rc�6�|jj�Sr�)rUr7rps rr7zTextIOWrapper.isatty�rCrc���|jrtd��t|t�s"t	d|j
jz��t|�}|jxs|jxrd|v}|r7|jr+|jdk7r|jd|j�}|jxs|j�}|j|�}|jj!|�|jr|sd|vr|j#�|j$�|j'd�d|_|j(r|j(j+�|S)zWrite data, where s is a strr zcan't write %s to text streamr�r�Nr()r}r4r+r/r1rer]r3r*r-r,r�r$r/�encoderUr�ryr�_set_decoded_charsr%r
)rfr��length�haslf�encoderr's      rr�zTextIOWrapper.write�s���;�;��3�4�4��!�S�!��;��K�K�0�0�1�2�
2��Q����%�%�=��)=�)=�L�4�1�9���T�)�)�d�m�m�t�.C��	�	�$��
�
�.�A��-�-�6�4�#4�#4�#6���N�N�1��������!�����U�d�a�i��J�J�L��>�>�%��#�#�B�'�!�D�N��=�=��M�M���!��
rc��tj|j�}||j�|_|jSr�)r��getincrementalencoderr"r#r$)rf�make_encoders  rr/zTextIOWrapper._get_encoder�s0���3�3�D�N�N�C��$�T�\�\�2��
��}�}�rc��tj|j�}||j�}|jrt||j�}||_|Sr�)r��getincrementaldecoderr"r#r'r�r(r%)rf�make_decoderr�s   r�_get_decoderzTextIOWrapper._get_decoder�sK���3�3�D�N�N�C���t�|�|�,�����/���9L�9L�M�G���
��rc� �||_d|_y)zSet the _decoded_chars buffer.rN)rr)rf�charss  rrGz TextIOWrapper._set_decoded_chars�s��#���#$�� rc��|j}|�|j|d}n|j|||z}|xjt|�z
c_|S)z'Advance into the _decoded_chars buffer.N)rrr3)rfr��offsetrSs    r�_get_decoded_charsz TextIOWrapper._get_decoded_chars�sT���)�)���9��'�'���0�E��'�'��v��z�:�E�� � �C��J�.� ��rc�J�	ddl}|j�S#t$rYywxYw)Nrr)r�getencoding�ImportError)rfrs  rrz"TextIOWrapper._get_locale_encoding�s/��	(��
�%�%�'�'��	�	��	�s��	"�"c�b�|j|krtd��|xj|zc_y)z!Rewind the _decoded_chars buffer.z"rewind decoded_chars out of boundsN)r�AssertionErrorrms  r�_rewind_decoded_charsz#TextIOWrapper._rewind_decoded_chars�s-���#�#�a�'� �!E�F�F�� � �A�%� rc�&�|j�td��|jr|jj�\}}|jr&|j
j
|j�}n%|j
j|j�}|}|jj||�}|j|�|r't|�t|j�z|_
nd|_
|jr|zf|_|S)zQ
        Read and decode the next chunk of data from the BufferedReader.
        z
no decoderr!)r%r4rrrrUr��_CHUNK_SIZEr�r�rGr3rr&r)rf�
dec_buffer�	dec_flags�input_chunk�eof�
decoded_charss      r�_read_chunkzTextIOWrapper._read_chunk�s����=�=� ��\�*�*��=�=�%)�M�M�$:�$:�$<�!�J�	�
�?�?��+�+�+�+�D�,<�,<�=�K��+�+�*�*�4�+;�+;�<�K��o���
�
�,�,�[�#�>�
����
�.�� ��-��D�4G�4G�0H�H�D�N� �D�N��=�=�(��k�)A�B�D�N��w�rc�H�||dzz|dzz|dzzt|�dzzS)N�@���)r)rfr0r`�
bytes_to_feed�need_eof�
chars_to_skips      r�_pack_cookiezTextIOWrapper._pack_cookie	s=���I�r�M�*�m�S�.@�A��s�"�$�&*�8�n�c�&9�:�	;rc��t|d�\}}t|d�\}}t|d�\}}t|d�\}}|||t|�|fS)Nl)�divmodr)rf�bigint�restr0r`rjrkrls        r�_unpack_cookiezTextIOWrapper._unpack_cookie	sY�����.���h� ��u�-���i�$�T�5�1���m�"(��u�"5���-���M�4��>�=�P�Prc
�R�|jstd��|jstd��|j	�|j
j
�}|j}|�|j�|jrtd��|S|j\}}|t|�z}|j}|dk(r|j||�S|j�}	t|j |z�}d}|t|�ksJ�|dkDrs|j#d|f�t|j%|d|��}	|	|kr.|j�\}
}|
s|}||	z}n6|t|
�z}d}n
||z}|dz}|dkDr�sd}|j#d|f�||z}|}
|dk(r#|j||
�|j#|�Sd}d}d}t'|t|��D][}|dz
}|t|j%|||dz��z
}|j�\}}|s||kr||z
}||z}|dd}}}
||k\s�[n2|t|j%dd	�
��z
}d	}||krtd��|j||
|||�|j#|�S#|j#|�wxYw)N�!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textrrrrFTr�z'can't reconstruct logical file position)r�r\rr<ryrUrqr%rrr[r3rrmrr,r&rr��range)rfr0r�r`�
next_inputrl�saved_state�
skip_bytes�	skip_backr�r'�d�	start_pos�start_flags�	bytes_fedrk�
chars_decoded�ir_s                   rrqzTextIOWrapper.tell	s����~�~�&�'J�K�K��}�}��D�E�E��
�
���;�;�#�#�%���-�-���?�d�n�n�4��"�"�$�%;�<�<��O�!%����	�:��C�
�O�#���0�0�
��A���$�$�X�y�9�9��&�&�(��F	*��T�^�^�m�;�<�J��I���Z��0�0�0��q�.�� � �#�y�!1�2�����z�+�:�'>�?�@���
�%�"�+�+�-�D�A�q��$%�	�%��*�
���#�a�&�(�J� !�I��)�+�J� )�A�
�I�#�q�.�&�
�� � �#�y�!1�2�!�:�-�I�#�K���!��(�(��K�@�@
���[�)�5�I��H��M��:�s�:��7�
M���Q��	���W�^�^�J�q��1��4E�%F�!G�G�
�(/�(8�(8�(:�%�
�I�!�m�}�&D���*�I�!�]�2�M�<E�q�!�M��K� �M�1��
M���W�^�^�C�t�^�%D�!E�E�
��� �=�0�!�"K�L�L��$�$��;�	�8�]�L�
���[�)��G���[�)�s!�B!J�?2J�A5J�9AJ�J&c�|�|j�|�|j�}|jj|�Sr�)ryrqrUrsrts  rrszTextIOWrapper.truncatey	s0���
�
���;��)�)�+�C��{�{�#�#�C�(�(rc�z�|j�td��|j�|j}d|_|S)Nzbuffer is already detached)rUr4ryr)rfrUs  rr�zTextIOWrapper.detach	s6���;�;���9�:�:��
�
����������
rc�����fd�}�jrtd���jstd��|tk(r#|dk7rtd��d}�j�}n�|tk(r�|dk7rtd���j��jjd|�}�jd�d�_�jr�jj�||�|S|dk7rtd|�d	���|dkrtd
|�����j��j|�\}}}}}	�jj|��jd�d�_|dk(r'�jr�jj�nY�js|s|	rI�jxs�j��_�jj!d|f�|df�_|	ry�jj#|�}
�j�jj%|
|��||
f�_t'�j(�|	krt+d��|	�_||�|S)
Nc���	�jxs�j�}|dk7r|jd�y|j�y#t$rYywxYw)z9Reset the encoder (merely useful for proper BOM handling)rN)r$r/rr
r)r0rJrfs  �r�_reset_encoderz*TextIOWrapper.seek.<locals>._reset_encoder�	sS���	
$��-�-�>�4�+<�+<�+>��
�q�=��$�$�Q�'��M�M�O���
��
�s�A	�		A�Ar+rtrz#can't do nonzero cur-relative seeksz#can't do nonzero end-relative seeksr(zunsupported whence (�)r'rz#can't restore logical file position)r}r4r�r\r	rqr
ryrUrjrGrr%r
rrrQrr�r�r3rr<r)rf�cookiernr�r0r{r`rjrkrlras`          rrjzTextIOWrapper.seek�	s-���	$��;�;��2�3�3��~�~�&�'J�K�K��X����{�*�+P�Q�Q��F��Y�Y�[�F�
�x�
���{�*�+P�Q�Q��J�J�L��{�{�'�'��6�2�H��#�#�B�'�!�D�N��}�}��
�
�#�#�%��8�$��O��Q�;��&�B�C�C��A�:��F�D�E�E��
�
��

����'�	E�	�9�m�X�}�	
������#�����#�����Q�;�4�=�=��M�M���!�
�]�]�i�=� �M�M�@�T�->�->�-@�D�M��M�M�"�"�C��#3�4�'��-�D�N���+�+�*�*�=�9�K��#�#��
�
�$�$�[�(�;�
=�'��5�D�N��4�&�&�'�-�7��C�D�D�'4�D�$��v���
rc�b�|j�|�d}n	|j}|�}|jxs|j�}|dkrb|j
�|j|jj�d��z}|j�|jd�d|_
|Sd}|j
|�}t|�|krD|sB|j�}||j
|t|�z
�z
}t|�|kr|s�B|S#t$rt|�d���wxYw)Nr*r�rTr�r(F)r�r�r=r1r%rQrVr�rUr�rrGr3rd)rfr�r�r�rRrbs      rr�zTextIOWrapper.read�	s1�������<��D�
$�!�^�^�
�"�|���-�-�6�4�#4�#4�#6���!�8��-�-�/��n�n�T�[�[�%5�%5�%7�t�n�D�E�F��~�~�)��'�'��+�!%����M��C��,�,�T�2�F��f�+��$�S��*�*�,�,���$�1�1�$��V��2D�E�E���f�+��$�S��M��)"�
?��4�(�*<� =�>�>�
?�s�D�D.c�t�d|_|j�}|sd|_|j|_t�|S)NF)rr�rr�r�r�s  rr�zTextIOWrapper.__next__�	s4����
��}�}����!�D�N� �N�N�D�M����rc�$�|jrtd��|�d}n	|j}|�}|j�}d}|js|j�dx}}	|jr*|jd|�}|dk\r|dz}�n;t|�}n�|jrj|jd|�}|jd|�}|dk(r|dk(rt|�}ni|dz}n�|dk(r|dz}n�||kr|dz}n�||dzk(r|dz}n�|dz}n�|j|j�}|dk\r|t|j�z}n�|dk\rt|�|k\r|}nj|j�r|jrn|j�r�|jr||j�z
}n|jd	�d|_|S��e|dk\r||kDr|}|j#t|�|z
�|d|S#t$rt	|�d���wxYw)
Nrr*r�rr�rr�rr()r}r4r�r=r1rVr%rQr(r�r3r'r)rdrrGrr\)	rfr�r�r��startrm�endpos�nlpos�crposs	         rr�zTextIOWrapper.readline�	sN���;�;��4�5�5��<��D�
$�!�^�^�
�"�|���&�&�(�����}�}��������f���"�"��i�i��e�,���!�8� �1�W�F����I�E��$�$�
�	�	�$��.���	�	�$��.���B�;���{� #�D�	��"'������b�[�"�Q�Y�F���U�]�"�Q�Y�F���e�a�i�'�"�Q�Y�F��#�Q�Y�F���i�i����-���!�8� �3�t�|�|�#4�4�F���q�y�S��Y�$�.�����"�"�$��&�&���"�"�$��"�"���/�/�1�1���'�'��+�!%�����}�@�1�9��$���F�	
�"�"�3�t�9�v�#5�6��G�V�}���g"�
?��4�(�*<� =�>�>�
?�s�G7�7Hc�J�|jr|jjSdSr�)r%r�rps rr�zTextIOWrapper.newlinesU
s��)-���t�}�}�%�%�@�D�@r)NNNFFr�)rrFrr�)-r]r^r_r�r^rr�rrrr�rrFrSrrUr9r:r�r�r�ryrCr}rgr:r7r�r/rQrGrVrr\rdrmrrrqrsr�rjr�r�r�r�r`rrrArA�s~���,�K��G�
DH�5:�7�BG�>B�7<��HA�"���������$��$��#��#�����"�$��#'�t�)7�V�
&�&�'�$��"��"�� �� �$�$��0�
�%�
�(�&�(�T01�JK�;�Q�a*�F)��I�V�:�[�z�A��ArrAc�V��eZdZdZd�fd�	Zd�Zd�Zed��Zed��Z	d�Z
�xZS)	�StringIOz�Text I/O implementation using an in-memory buffer.

    The initial_value argument sets the value of object.  The newline
    argument is like the one of TextIOWrapper's constructor.
    c���tt|�t�dd|��|�d|_|�`t|t�s-tdjt|�j���|j|�|jd�yy)Nr�
surrogatepass)rrFrGFz*initial_value must be str or None, not {0}r)
rr�r�r	r*r+r/r1rrr]r�rj)rf�
initial_valuerGres   �rr�zStringIO.__init__a
s����
�h��&�w�y�07�.=�/6�	'�	8��?�#(�D� ��$��m�S�1�� L�!'���]�(;�(D�(D�!E�G�G��J�J�}�%��I�I�a�L�%rc�D�|j�|jxs|j�}|j�}|j	�	|j|jj�d��|j|�S#|j|�wxYw)NTr�)	ryr%rQrr
r�rUrr)rfr��	old_states   rrzStringIO.getvalueq
sx���
�
���-�-�6�4�#4�#4�#6���$�$�&�	��
�
��	(��>�>�$�+�+�"6�"6�"8��>�E����Y�'��G���Y�'�s�*B�Bc�,�tj|�Sr�)�objectrrps rrzStringIO.__repr__{
s�����t�$�$rc��yr�r`rps rrFzStringIO.errors�
���rc��yr�r`rps rrzStringIO.encoding�
r�rc�&�|jd�y)Nr�rkrps rr�zStringIO.detach�
s�����(�#r)r(r�)r]r^r_r�r�rrr�rFrr�r2r3s@rr�r�Z
sD����� (�%�
��������$rr�)r)r"r*NNNTN)9r�r-�abcr�rcr�r�_threadrr9�platform�msvcrtrr��iorrr	r
rYr��addr
�	SEEK_DATAr8rbr�dev_moder~rr�staticmethodrVrZ�	open_coder=r\r<r4�ABCMetarb�registerr��_ior6r�r�r	r@r?rrr>r�r�r�rAr�r`rr�<module>r�sa���
�
�
���
�)��<�<�&�&�*��H�	�6�6���
�2�{��������&�������&���"��$�C�);�<�R��	�	�@R�@R��(�
��B�=A�,0�K��K�^� (����I�
��2�2��_�s�{�{�_�B	�	�	���6��8#��8#�t�����i� ��	���6��e$�V�e$�N�����>�*�h!�~�h!�VL�n�L�^F�%�F�Pf!�%�f!�RF"�^�F"�RG-�^�^�G-�TT�Y�T�n
>��>�@�
�
���z�"�R�� 9� 9�R�jb
A�J�b
A�J0$�}�0$��YI�(�'�I�(���
�
�w�
�
�
�s$�H�H �H�H� H5�4H5

Zerion Mini Shell 1.0