OwlCyberSecurity - MANAGER
Edit File: _pyio.cpython-34.pyc
� f f� �����������������@���s���d��Z��d�d�l�Z�d�d�l�Z�d�d�l�Z�d�d�l�Z�y�d�d�l�m�Z�Wn"�e�k �rn�d�d�l �m�Z�Yn�Xd�d�l �Z �d�d�l �m�Z�m�Z�m �Z �m�Z�d�d�d�h�Z�e�e�d���r��e�j�e�j���e�j�e�j���n��d�d �Z�e�Z�d �d�d�d�d�d�d�d�d ���Z�Gd�d����d���Z�Gd�d����d���Z�y �e �j�Z�Wn+�e�k �rpGd�d����d�e�e���Z�Yn�XGd�d����d�d�e�j��Z�e �j�j�e���Gd�d����d�e���Z �e �j �j�e ���d�d�l!�m"�Z"�e �j�e"���Gd�d����d�e���Z#�e �j#�j�e#���Gd�d����d�e#���Z$�Gd�d����d�e#���Z%�Gd �d!����d!�e$���Z&�Gd"�d#����d#�e$���Z'�Gd$�d%����d%�e#���Z(�Gd&�d'����d'�e'�e&���Z)�Gd(�d)����d)�e���Z*�e �j*�j�e*���Gd*�d+����d+�e�j+���Z,�Gd,�d-����d-�e*���Z-�Gd.�d/����d/�e-���Z.�d�S)0z) Python implementation of the io module. �����N)� allocate_lock)�__all__�SEEK_SET�SEEK_CUR�SEEK_END��������� SEEK_HOLE����i����rTc�������������C���s���t��|��t�t�t�f���s+�t�d�|������n��t��|�t���sM�t�d�|�����n��t��|�t���so�t�d�|�����n��|�d�k �r��t��|�t���r��t�d�|�����n��|�d�k �r��t��|�t���r��t�d�|�����n��t�|���}�|�t�d���st�|���t�|���k�rt�d�|�����n��d�|�k�} �d �|�k�} �d �|�k�}�d�|�k�}�d�|�k�} �d �|�k�}�d�|�k�}�d�|�k�r�| �s�|�s�|�r�t�d�����n��d�d�l�}�|�j �d�t �d���d�} �n��|�r�|�r�t�d�����n��| �| �|�|�d�k�r�t�d�����n��| �p| �p|�p|�s&t�d�����n��|�rG|�d�k �rGt�d�����n��|�rh|�d�k �rht�d�����n��|�r�|�d�k �r�t�d�����n��t�|��| �r�d�p�d�| �r�d �p�d�|�r�d �p�d�|�r�d�p�d�| �r�d�p�d�|�d�|��}�|�}�y}d�}�|�d�k�s |�d�k��r/|�j����r/d"�}�d�}�n��|�d�k��r�t �}�y�t�j�|�j������j�}�Wn�t�t�f�k �rwYq�X|�d�k�r�|�}�q�n��|�d�k��r�t�d�����n��|�d�k�r�|�r�|�St�d �����n��| �r�t�|�|���}�nL�| �s�|�s�|�rt�|�|���}�n(�| �r$t�|�|���}�n�t�d!�|�����|�}�|�rD|�St�|�|�|�|�|���}�|�}�|�|�_�|�SWn�|�j�������Yn�Xd�S)#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) 'U' universal newline mode (deprecated) ========= =============================================================== 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. 'U' mode is deprecated and will raise an exception in future versions of Python. It has no effect in Python 3. Use newline to control universal newlines mode. 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: %rNzinvalid encoding: %rzinvalid errors: %rzaxrwb+tU�xr����w�a�+�t�b�Uz$can't use U and writing mode at oncer���z'U' mode is deprecatedr���Tz'can't have text and binary mode at oncer���z)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 argument���openerFzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r���)� isinstance�str�bytes�int� TypeError�set�len� ValueError�warnings�warn�DeprecationWarning�FileIO�isatty�DEFAULT_BUFFER_SIZE�os�fstat�fileno� st_blksize�OSError�AttributeError�BufferedRandom�BufferedWriter�BufferedReader� TextIOWrapper�mode�close)�filer.���� buffering�encoding�errors�newline�closefdr���ZmodesZcreatingZreadingZwritingZ appendingZupdating�textZbinaryr����raw�result�line_bufferingZbs�buffer��r;����*/opt/alt/python34/lib64/python3.4/_pyio.py�open"���s�����{( ?$ r=���c���������������@���s"���e��Z�d��Z�d�Z�d�d����Z�d�S)� DocDescriptorz%Helper for builtins.open.__doc__ c�������������C���s���d�t��j�S)Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True) )r=����__doc__)�self�obj�typr;���r;���r<����__get__����s����zDocDescriptor.__get__N)�__name__� __module__�__qualname__r?���rC���r;���r;���r;���r<���r>�������s���r>���c���������������@���s+���e��Z�d��Z�d�Z�e����Z�d�d����Z�d�S)�OpenWrapperz�Wrapper for builtins.open Trick so that open won't become a bound method when stored as a class variable (as dbm.dumb does). See initstdio() in Python/pythonrun.c. c�������������O���s ���t��|�|����S)N)r=���)�cls�args�kwargsr;���r;���r<����__new__��s����zOpenWrapper.__new__N)rD���rE���rF���r?���r>���rK���r;���r;���r;���r<���rG�������s��� rG���c���������������@���s���e��Z�d��Z�d�S)�UnsupportedOperationN)rD���rE���rF���r;���r;���r;���r<���rL�����s���rL���c���������������@���sZ��e��Z�d��Z�d�Z�d�d����Z�d�d�d���Z�d�d����Z�d �d �d���Z�d�d ����Z�d�Z �d�d����Z �d�d����Z�d�d����Z�d �d�d���Z �d�d����Z�d �d�d���Z�d�d����Z�d �d�d���Z�e�d�d ������Z�d �d!�d"���Z�d#�d$����Z�d%�d&����Z�d'�d(����Z�d)�d*����Z�d6�d,�d-���Z�d.�d/����Z�d0�d1����Z�d �d2�d3���Z�d4�d5����Z�d �S)7�IOBasea-��The abstract base class for all I/O classes, acting on streams of bytes. There is no public constructor. 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, readinto, 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. bytearrays are accepted too, and in some cases (such as readinto) needed. 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�������������C���s ���t��d�|��j�j�|�f�����d�S)z@Internal: raise an OSError exception for unsupported operations.z%s.%s() not supportedN)rL���� __class__rD���)r@����namer;���r;���r<����_unsupported7��s����zIOBase._unsupportedr���c�������������C���s���|��j��d���d�S)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)rP���)r@����pos�whencer;���r;���r<���rQ���>��s����zIOBase.seekc�������������C���s���|��j��d�d���S)z5Return an int indicating the current stream position.r���r���)rQ���)r@���r;���r;���r<����tellN��s����zIOBase.tellNc�������������C���s���|��j��d���d�S)z�Truncate file to size bytes. Size defaults to the current IO position as reported by tell(). Return the new size. �truncateN)rP���)r@���rR���r;���r;���r<���rU���R��s����zIOBase.truncatec�������������C���s���|��j�����d�S)zuFlush write buffers, if applicable. This is not implemented for read-only and non-blocking streams. N)�_checkClosed)r@���r;���r;���r<����flush\��s����zIOBase.flushFc�������������C���s+���|��j��s'�z�|��j����Wd�d�|��_��Xn��d�S)ziFlush and close the IO object. This method has no effect if the file is already closed. NT)�_IOBase__closedrW���)r@���r;���r;���r<���r/���f��s���� zIOBase.closec���������� ���C���s���y�|��j�����Wn�Yn�Xd�S)zDestructor. Calls close().N)r/���)r@���r;���r;���r<����__del__q��s����zIOBase.__del__c�������������C���s���d�S)z�Return a bool indicating whether object supports random access. If False, seek(), tell() and truncate() will raise UnsupportedOperation. This method may need to do a test seek(). Fr;���)r@���r;���r;���r<����seekable��s����zIOBase.seekablec�������������C���s1���|��j�����s-�t�|�d�k�r!�d�n�|�����n��d�S)zEInternal: raise UnsupportedOperation if file is not seekable NzFile or stream is not seekable.)rZ���rL���)r@����msgr;���r;���r<����_checkSeekable���s����zIOBase._checkSeekablec�������������C���s���d�S)z�Return a bool indicating whether object was opened for reading. If False, read() will raise UnsupportedOperation. Fr;���)r@���r;���r;���r<����readable���s����zIOBase.readablec�������������C���s1���|��j�����s-�t�|�d�k�r!�d�n�|�����n��d�S)zEInternal: raise UnsupportedOperation if file is not readable NzFile or stream is not readable.)r]���rL���)r@���r[���r;���r;���r<����_checkReadable���s����zIOBase._checkReadablec�������������C���s���d�S)z�Return a bool indicating whether object was opened for writing. If False, write() and truncate() will raise UnsupportedOperation. Fr;���)r@���r;���r;���r<����writable���s����zIOBase.writablec�������������C���s1���|��j�����s-�t�|�d�k�r!�d�n�|�����n��d�S)zEInternal: raise UnsupportedOperation if file is not writable NzFile or stream is not writable.)r_���rL���)r@���r[���r;���r;���r<����_checkWritable���s����zIOBase._checkWritablec�������������C���s���|��j��S)z�closed: bool. True iff the file has been closed. For backwards compatibility, this is a property, not a predicate. )rX���)r@���r;���r;���r<����closed���s����z IOBase.closedc�������������C���s.���|��j��r*�t�|�d�k�r�d�n�|�����n��d�S)z8Internal: raise an ValueError if file is closed NzI/O operation on closed file.)ra���r���)r@���r[���r;���r;���r<���rV������s���� zIOBase._checkClosedc�������������C���s���|��j�����|��S)zCContext management protocol. Returns self (an instance of IOBase).)rV���)r@���r;���r;���r<���� __enter__���s���� zIOBase.__enter__c�������������G���s���|��j�����d�S)z+Context management protocol. Calls close()N)r/���)r@���rI���r;���r;���r<����__exit__���s����zIOBase.__exit__c�������������C���s���|��j��d���d�S)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&���N)rP���)r@���r;���r;���r<���r&������s����z IOBase.filenoc�������������C���s���|��j�����d�S)z{Return a bool indicating whether this is an 'interactive' stream. Return False if it can't be determined. F)rV���)r@���r;���r;���r<���r"������s���� z IOBase.isattyr���c����������������s����t�����d���r'������f�d�d����}�n�d�d����}���d�k�rH�d ���n�t���t���sf�t�d�����n��t����}�x[���d�k��s��t�|�����k��r�����j�|������}�|�s��Pn��|�|�7}�|�j�d ���rr�Pqr�qr�Wt�|���S)aN��Read 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�����������������sZ������j��d���}��|��s�d�S|��j�d���d�p5�t�|����}���d�k�rV�t�|�����}�n��|�S)Nr���s��� r���)rd����findr����min)Z readahead�n)r@����sizer;���r<���� nreadahead���s����z#IOBase.readline.<locals>.nreadaheadc���������������S���s���d�S)Nr���r;���r;���r;���r;���r<���ri������s����Nr���zsize must be an integerr���s��� r���) �hasattrr���r���r���� bytearrayr����read�endswithr���)r@���rh���ri����resr���r;���)r@���rh���r<����readline���s ���� ! zIOBase.readlinec�������������C���s���|��j�����|��S)N)rV���)r@���r;���r;���r<����__iter__���s���� zIOBase.__iter__c�������������C���s���|��j�����}�|�s�t���n��|�S)N)ro���� StopIteration)r@����liner;���r;���r<����__next__��s���� zIOBase.__next__c�������������C���sp���|�d�k�s�|�d�k�r"�t��|����Sd�}�g��}�x;�|��D]3�}�|�j�|���|�t�|���7}�|�|�k�r5�Pq5�q5�W|�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. Nr���)�list�appendr���)r@���Zhintrg����linesrr���r;���r;���r<���� readlines��s���� zIOBase.readlinesc�������������C���s,���|��j�����x�|�D]�}�|��j�|���q�Wd��S)N)rV����write)r@���rv���rr���r;���r;���r<���� writelines��s���� zIOBase.writelinesr���)rD���rE���rF���r?���rP���rQ���rT���rU���rW���rX���r/���rY���rZ���r\���r]���r^���r_���r`����propertyra���rV���rb���rc���r&���r"���ro���rp���rs���rw���ry���r;���r;���r;���r<���rM�����s4��� %rM���� metaclassc���������������@���sI���e��Z�d��Z�d�Z�d�d�d���Z�d�d����Z�d�d����Z�d �d ����Z�d�S) � RawIOBasezBase class for raw binary I/O.r���c�������������C���ss���|�d�k�r�d�}�n��|�d�k��r+�|��j�����St�|�j������}�|��j�|���}�|�d�k�r\�d�S|�|�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���r���)�readallrk���� __index__�readintor���)r@���rh���r���rg���r;���r;���r<���rl���0��s���� zRawIOBase.readc�������������C���sK���t�����}�x'�|��j�t���}�|�s%�Pn��|�|�7}�q�W|�rC�t�|���S|�Sd�S)z+Read until EOF, using multiple read() call.N)rk���rl���r#���r���)r@���rn����datar;���r;���r<���r}���A��s���� zRawIOBase.readallc�������������C���s���|��j��d���d�S)z�Read up to len(b) bytes into bytearray 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���N)rP���)r@���r���r;���r;���r<���r���O��s����zRawIOBase.readintoc�������������C���s���|��j��d���d�S)z~Write the given buffer to the IO stream. Returns the number of bytes written, which may be less than len(b). rx���N)rP���)r@���r���r;���r;���r<���rx���W��s����zRawIOBase.writeNr���)rD���rE���rF���r?���rl���r}���r���rx���r;���r;���r;���r<���r|���"��s ���r|���)r!���c���������������@���sX���e��Z�d��Z�d�Z�d�d�d���Z�d�d�d���Z�d�d����Z�d �d ����Z�d�d����Z�d�S) �BufferedIOBasea��Base 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. Nc�������������C���s���|��j��d���d�S)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. rl���N)rP���)r@���rh���r;���r;���r<���rl���t��s����zBufferedIOBase.readc�������������C���s���|��j��d���d�S)zaRead up to size bytes with at most one read() system call, where size is an int. �read1N)rP���)r@���rh���r;���r;���r<���r�������s����zBufferedIOBase.read1c�������������C���s����|��j��t�|�����}�t�|���}�y�|�|�d�|���<Wnh�t�k �r��}�zH�d�d�l�}�t�|�|�j���sq�|���n��|�j�d�|���|�d�|���<WYd�d�}�~�Xn�X|�S)a[��Read up to len(b) bytes into bytearray 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. Nr���r���)rl���r���r����arrayr���)r@���r���r����rg����errr����r;���r;���r<���r������s���� /zBufferedIOBase.readintoc�������������C���s���|��j��d���d�S)a��Write the given bytes buffer to the IO stream. Return the number of bytes written, which is never less than len(b). Raises BlockingIOError if the buffer is full and the underlying raw stream cannot accept more data at the moment. rx���N)rP���)r@���r���r;���r;���r<���rx������s���� zBufferedIOBase.writec�������������C���s���|��j��d���d�S)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. �detachN)rP���)r@���r;���r;���r<���r�������s����zBufferedIOBase.detach) rD���rE���rF���r?���rl���r����r���rx���r����r;���r;���r;���r<���r����c��s���r����c���������������@���s��e��Z�d��Z�d�Z�d�d����Z�d�d�d���Z�d�d����Z�d �d �d���Z�d�d ����Z�d�d����Z �d�d����Z �d�d����Z�d�d����Z�d�d����Z �e�d�d������Z�e�d�d������Z�e�d�d������Z�e�d�d������Z�d �d!����Z�d"�d#����Z�d$�d%����Z�d&�d'����Z�d �S)(�_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�������������C���s ���|�|��_��d��S)N)�_raw)r@���r7���r;���r;���r<����__init__���s����z_BufferedIOMixin.__init__r���c�������������C���s4���|��j��j�|�|���}�|�d�k��r0�t�d�����n��|�S)Nr���z#seek() returned an invalid position)r7���rQ���r(���)r@���rR���rS���Znew_positionr;���r;���r<���rQ������s����z_BufferedIOMixin.seekc�������������C���s.���|��j��j����}�|�d�k��r*�t�d�����n��|�S)Nr���z#tell() returned an invalid position)r7���rT���r(���)r@���rR���r;���r;���r<���rT������s����z_BufferedIOMixin.tellNc�������������C���s5���|��j�����|�d��k�r%�|��j����}�n��|��j�j�|���S)N)rW���rT���r7���rU���)r@���rR���r;���r;���r<���rU������s���� z_BufferedIOMixin.truncatec�������������C���s)���|��j��r�t�d�����n��|��j�j����d��S)Nzflush of closed file)ra���r���r7���rW���)r@���r;���r;���r<���rW������s���� z_BufferedIOMixin.flushc���������� ���C���s?���|��j��d��k �r;�|��j�r;�z�|��j����Wd��|��j��j����Xn��d��S)N)r7���ra���rW���r/���)r@���r;���r;���r<���r/������s����z_BufferedIOMixin.closec�������������C���s>���|��j��d��k�r�t�d�����n��|��j����|��j�}�d��|��_�|�S)Nzraw stream already detached)r7���r���rW���r����)r@���r7���r;���r;���r<���r�������s���� z_BufferedIOMixin.detachc�������������C���s ���|��j��j����S)N)r7���rZ���)r@���r;���r;���r<���rZ������s����z_BufferedIOMixin.seekablec�������������C���s ���|��j��j����S)N)r7���r]���)r@���r;���r;���r<���r]������s����z_BufferedIOMixin.readablec�������������C���s ���|��j��j����S)N)r7���r_���)r@���r;���r;���r<���r_�����s����z_BufferedIOMixin.writablec�������������C���s���|��j��S)N)r����)r@���r;���r;���r<���r7�����s����z_BufferedIOMixin.rawc�������������C���s ���|��j��j�S)N)r7���ra���)r@���r;���r;���r<���ra�����s����z_BufferedIOMixin.closedc�������������C���s ���|��j��j�S)N)r7���rO���)r@���r;���r;���r<���rO�����s����z_BufferedIOMixin.namec�������������C���s ���|��j��j�S)N)r7���r.���)r@���r;���r;���r<���r.�����s����z_BufferedIOMixin.modec�������������C���s���t��d�j�|��j�j�������d��S)Nz can not serialize a '{0}' object)r����formatrN���rD���)r@���r;���r;���r<����__getstate__��s���� z_BufferedIOMixin.__getstate__c�������������C���sO���|��j��j�}�y �|��j�}�Wn�t�k �r:�d�j�|���SYn�Xd�j�|�|���Sd��S)Nz<_pyio.{0}>z<_pyio.{0} name={1!r}>)rN���rD���rO���� Exceptionr����)r@���ZclsnamerO���r;���r;���r<����__repr__��s���� z_BufferedIOMixin.__repr__c�������������C���s ���|��j��j����S)N)r7���r&���)r@���r;���r;���r<���r&���#��s����z_BufferedIOMixin.filenoc�������������C���s ���|��j��j����S)N)r7���r"���)r@���r;���r;���r<���r"���&��s����z_BufferedIOMixin.isatty)rD���rE���rF���r?���r����rQ���rT���rU���rW���r/���r����rZ���r]���r_���rz���r7���ra���rO���r.���r����r����r&���r"���r;���r;���r;���r<���r�������s&��� r����c�������������������s����e��Z�d��Z�d�Z�d�d�d���Z�d�d����Z�d�d����Z�d �d ����Z����f�d�d����Z�d�d �d���Z �d�d����Z �d�d����Z�d�d�d���Z�d�d����Z �d�d�d���Z�d�d����Z�d�d����Z�d�d����Z����S) �BytesIOz<Buffered I/O implementation using an in-memory bytes buffer.Nc�������������C���s8���t�����}�|�d��k �r"�|�|�7}�n��|�|��_�d�|��_�d��S)Nr���)rk����_buffer�_pos)r@���Z initial_bytes�bufr;���r;���r<���r����.��s ���� zBytesIO.__init__c�������������C���s%���|��j��r�t�d�����n��|��j�j����S)Nz__getstate__ on closed file)ra���r����__dict__�copy)r@���r;���r;���r<���r����5��s���� zBytesIO.__getstate__c�������������C���s%���|��j��r�t�d�����n��t�|��j���S)z8Return the bytes value (contents) of the buffer zgetvalue on closed file)ra���r���r���r����)r@���r;���r;���r<����getvalue:��s���� zBytesIO.getvaluec�������������C���s%���|��j��r�t�d�����n��t�|��j���S)z;Return a readable and writable view of the buffer. zgetbuffer on closed file)ra���r���� memoryviewr����)r@���r;���r;���r<���� getbufferA��s���� zBytesIO.getbufferc����������������s���|��j��j����t����j����d��S)N)r�����clear�superr/���)r@���)rN���r;���r<���r/���H��s���� z BytesIO.closec�������������C���s����|��j��r�t�d�����n��|�d��k�r-�d�}�n��|�d�k��rK�t�|��j���}�n��t�|��j���|��j�k�rg�d�St�t�|��j���|��j�|���}�|��j�|��j�|���}�|�|��_�t�|���S)Nzread from closed filer���r��������r���)ra���r���r���r����r����rf���r���)r@���rh���Znewposr���r;���r;���r<���rl���L��s���� zBytesIO.readc�������������C���s ���|��j��|���S)z"This is the same as read. )rl���)r@���rh���r;���r;���r<���r����Z��s����z BytesIO.read1c�������������C���s����|��j��r�t�d�����n��t�|�t���r6�t�d�����n��t�|���}�|�d�k�rR�d�S|��j�}�|�t�|��j���k�r��d�|�t�|��j���}�|��j�|�7_�n��|�|��j�|�|�|���<|��j�|�7_�|�S)Nzwrite to closed filez can't write str to binary streamr���s����)ra���r���r���r���r���r���r����r����)r@���r���rg���rR���Zpaddingr;���r;���r<���rx���_��s���� z BytesIO.writer���c�������������C���s����|��j��r�t�d�����n��y�|�j�Wn4�t�k �rY�}�z�t�d���|���WYd��d��}�~�Xn�X|�d�k�r��|�d�k��r��t�d�|�f�����n��|�|��_�nb�|�d�k�r��t�d�|��j�|���|��_�n:�|�d�k�r��t�d�t�|��j���|���|��_�n�t�d�����|��j�S)Nzseek on closed filezan integer is requiredr���znegative seek position %rr���r���zunsupported whence value) ra���r���r~���r)���r���r�����maxr���r����)r@���rR���rS���r����r;���r;���r<���rQ���q��s ���� ""zBytesIO.seekc�������������C���s���|��j��r�t�d�����n��|��j�S)Nztell on closed file)ra���r���r����)r@���r;���r;���r<���rT������s���� zBytesIO.tellc�������������C���s����|��j��r�t�d�����n��|�d��k�r0�|��j�}�nd�y�|�j�Wn4�t�k �rq�}�z�t�d���|���WYd��d��}�~�Xn�X|�d�k��r��t�d�|�f�����n��|��j�|�d����=|�S)Nztruncate on closed filezan integer is requiredr���znegative truncate position %r)ra���r���r����r~���r)���r���r����)r@���rR���r����r;���r;���r<���rU������s���� "zBytesIO.truncatec�������������C���s���|��j��r�t�d�����n��d�S)NzI/O operation on closed file.T)ra���r���)r@���r;���r;���r<���r]������s���� zBytesIO.readablec�������������C���s���|��j��r�t�d�����n��d�S)NzI/O operation on closed file.T)ra���r���)r@���r;���r;���r<���r_������s���� zBytesIO.writablec�������������C���s���|��j��r�t�d�����n��d�S)NzI/O operation on closed file.T)ra���r���)r@���r;���r;���r<���rZ������s���� zBytesIO.seekable)rD���rE���rF���r?���r����r����r����r����r/���rl���r����rx���rQ���rT���rU���r]���r_���rZ���r;���r;���)rN���r<���r����*��s���r����c���������������@���s����e��Z�d��Z�d�Z�e�d�d���Z�d�d����Z�d�d�d���Z�d�d �d ���Z�d�d�d ���Z �d�d�d���Z �d�d����Z�d�d����Z�d�d�d���Z �d�S)r,���a��BufferedReader(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�������������C���si���|�j�����s�t�d�����n��t�j�|��|���|�d�k�rF�t�d�����n��|�|��_�|��j����t����|��_�d�S)zMCreate a new buffered reader using the given readable raw IO object. z "raw" argument must be readable.r���zinvalid buffer sizeN) r]���r(���r����r����r����buffer_size�_reset_read_buf�Lock� _read_lock)r@���r7���r����r;���r;���r<���r�������s���� zBufferedReader.__init__c�������������C���s���d�|��_��d�|��_�d��S)Nr����r���)� _read_buf� _read_pos)r@���r;���r;���r<���r�������s���� zBufferedReader._reset_read_bufNc���������� ���C���sH���|�d�k �r'�|�d�k��r'�t��d�����n��|��j���|��j�|���SWd�QXd�S)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 readr���)r���r�����_read_unlocked)r@���rh���r;���r;���r<���rl������s���� zBufferedReader.readc�������������C���sO��d�}�d�}�|��j��}�|��j�}�|�d��k�s6�|�d�k�r'|��j����t�|��j�d���r��|��j�j����}�|�d��k�r��|�|�d����p��d��S|�|�d����|�Sn��|�|�d����g�}�d�}�xb�y�|��j�j����}�Wn�t�k �r��w��Yn�X|�|�k�r��|�}�Pn��|�t�|���7}�|�j �|���q��Wd�j �|���p&|�St�|���|�} �|�| �k�rd|��j�|�7_�|�|�|�|���S|�|�d����g�}�t�|��j�|���} �xq�| �|�k��r�y�|��j�j�| ���}�Wn�t�k �r�w�Yn�X|�|�k�r�|�}�Pn��| �t�|���7} �|�j �|���q�Wt �|�| ���}�d�j �|���}�|�|�d����|��_��d�|��_�|�rK|�d��|���S|�S)Nr����r���r}���r���)r����Nr���)r����r����r����rj���r7���r}���rl����InterruptedErrorr���ru����joinr����r����rf���)r@���rg���Z nodata_valZempty_valuesr����rR����chunkZchunksZcurrent_sizeZavailZwanted�outr;���r;���r<���r�������sZ���� zBufferedReader._read_unlockedr���c���������� ���C���s!���|��j����|��j�|���SWd�QXd�S)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. N)r�����_peek_unlocked)r@���rh���r;���r;���r<���rd�����s���� zBufferedReader.peekc�������������C���s����t��|�|��j���}�t�|��j���|��j�}�|�|�k��s@�|�d�k�r��|��j�|�}�x3�y�|��j�j�|���}�Wn�t�k �r}�wP�Yn�XPqP�W|�r��|��j�|��j�d����|�|��_�d�|��_�q��n��|��j�|��j�d����S)Nr���)rf���r����r���r����r����r7���rl���r����)r@���rg���ZwantZhaveZto_readZcurrentr;���r;���r<���r������s���� zBufferedReader._peek_unlockedc�������������C���sr���|�d�k��r�t��d�����n��|�d�k�r+�d�S|��j��8�|��j�d���|��j�t�|�t�|��j���|��j�����SWd�QXd�S)z<Reads up to size bytes, with at most one read() system call.r���z(number of bytes to read must be positiver����r���N)r���r����r����r����rf���r���r����r����)r@���rh���r;���r;���r<���r����%��s���� zBufferedReader.read1c�������������C���s!���t��j�|����t�|��j���|��j�S)N)r����rT���r���r����r����)r@���r;���r;���r<���rT���2��s����zBufferedReader.tellc�������������C���s{���|�t��k�r�t�d�����n��|��j��Q�|�d�k�rN�|�t�|��j���|��j�8}�n��t�j�|��|�|���}�|��j����|�SWd��QXd��S)Nzinvalid whence valuer���) �valid_seek_flagsr���r����r���r����r����r����rQ���r����)r@���rR���rS���r;���r;���r<���rQ���5��s���� zBufferedReader.seek)rD���rE���rF���r?���r#���r����r����rl���r����rd���r����r����rT���rQ���r;���r;���r;���r<���r,������s��� : r,���c���������������@���ss���e��Z�d��Z�d�Z�e�d�d���Z�d�d����Z�d�d�d���Z�d �d ����Z�d�d����Z �d �d����Z �d�d�d���Z�d�S)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�������������C���sk���|�j�����s�t�d�����n��t�j�|��|���|�d�k�rF�t�d�����n��|�|��_�t����|��_�t����|��_ �d��S)Nz "raw" argument must be writable.r���zinvalid buffer size) r_���r(���r����r����r���r����rk���� _write_bufr�����_write_lock)r@���r7���r����r;���r;���r<���r����H��s���� zBufferedWriter.__init__c�������������C���sb��|��j��r�t�d�����n��t�|�t���r6�t�d�����n��|��j��t�|��j���|��j�k�re�|��j ����n��t�|��j���}�|��j�j �|���t�|��j���|�}�t�|��j���|��j�k�rTy�|��j ����WqTt�k �rP}�zq�t�|��j���|��j�k�r>t�|��j���|��j�}�|�|�8}�|��j�d��|��j���|��_�t�|�j�|�j �|�����n��WYd��d��}�~�XqTXn��|�SWd��QXd��S)Nzwrite to closed filez can't write str to binary stream)ra���r���r���r���r���r����r���r����r�����_flush_unlocked�extend�BlockingIOError�errno�strerror)r@���r���ZbeforeZwritten�eZoverager;���r;���r<���rx���S��s(���� 1zBufferedWriter.writeNc���������� ���C���sL���|��j���=�|��j����|�d��k�r2�|��j�j����}�n��|��j�j�|���SWd��QXd��S)N)r����r����r7���rT���rU���)r@���rR���r;���r;���r<���rU���o��s ���� zBufferedWriter.truncatec�������������C���s���|��j����|��j����Wd��QXd��S)N)r����r����)r@���r;���r;���r<���rW���v��s���� zBufferedWriter.flushc�������������C���s����|��j��r�t�d�����n��x��|��j�r��y�|��j�j�|��j���}�Wn2�t�k �rT�w�Yn�t�k �rq�t�d�����Yn�X|�d��k�r��t�t�j �d�d�����n��|�t �|��j���k�s��|�d�k��r��t�d�����n��|��j�d��|���=q�Wd��S)Nzflush of closed filezHself.raw should implement RawIOBase: it should not raise BlockingIOErrorz)write could not complete without blockingr���z*write() returned incorrect number of bytes)ra���r���r����r7���rx���r����r�����RuntimeErrorr����ZEAGAINr���r(���)r@���rg���r;���r;���r<���r����z��s ���� !zBufferedWriter._flush_unlockedc�������������C���s���t��j�|����t�|��j���S)N)r����rT���r���r����)r@���r;���r;���r<���rT������s����zBufferedWriter.tellr���c�������������C���sL���|�t��k�r�t�d�����n��|��j��"�|��j����t�j�|��|�|���SWd��QXd��S)Nzinvalid whence value)r����r���r����r����r����rQ���)r@���rR���rS���r;���r;���r<���rQ������s ���� zBufferedWriter.seek)rD���rE���rF���r?���r#���r����rx���rU���rW���r����rT���rQ���r;���r;���r;���r<���r+���?��s���r+���c���������������@���s����e��Z�d��Z�d�Z�e�d�d���Z�d�d�d���Z�d�d����Z�d �d ����Z�d�d�d ���Z �d�d����Z �d�d����Z�d�d����Z�d�d����Z �d�d����Z�d�d����Z�e�d�d������Z�d�S)�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�������������C���s^���|�j�����s�t�d�����n��|�j����s6�t�d�����n��t�|�|���|��_�t�|�|���|��_�d�S)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)r@���r����r����r����r;���r;���r<���r�������s����zBufferedRWPair.__init__Nc�������������C���s%���|�d��k�r�d�}�n��|��j��j�|���S)Nr���r���)r����rl���)r@���rh���r;���r;���r<���rl������s���� zBufferedRWPair.readc�������������C���s���|��j��j�|���S)N)r����r���)r@���r���r;���r;���r<���r������s����zBufferedRWPair.readintoc�������������C���s���|��j��j�|���S)N)r����rx���)r@���r���r;���r;���r<���rx������s����zBufferedRWPair.writer���c�������������C���s���|��j��j�|���S)N)r����rd���)r@���rh���r;���r;���r<���rd������s����zBufferedRWPair.peekc�������������C���s���|��j��j�|���S)N)r����r����)r@���rh���r;���r;���r<���r�������s����zBufferedRWPair.read1c�������������C���s ���|��j��j����S)N)r����r]���)r@���r;���r;���r<���r]������s����zBufferedRWPair.readablec�������������C���s ���|��j��j����S)N)r����r_���)r@���r;���r;���r<���r_������s����zBufferedRWPair.writablec�������������C���s ���|��j��j����S)N)r����rW���)r@���r;���r;���r<���rW������s����zBufferedRWPair.flushc���������� ���C���s&���z�|��j��j����Wd��|��j�j����Xd��S)N)r����r/���r����)r@���r;���r;���r<���r/������s����zBufferedRWPair.closec�������������C���s���|��j��j����p�|��j�j����S)N)r����r"���r����)r@���r;���r;���r<���r"������s����zBufferedRWPair.isattyc�������������C���s ���|��j��j�S)N)r����ra���)r@���r;���r;���r<���ra������s����zBufferedRWPair.closed)rD���rE���rF���r?���r#���r����rl���r���rx���rd���r����r]���r_���rW���r/���r"���rz���ra���r;���r;���r;���r<���r�������s���r����c���������������@���s����e��Z�d��Z�d�Z�e�d�d���Z�d�d�d���Z�d�d����Z�d �d �d���Z�d �d�d ���Z �d�d����Z �d�d�d���Z�d�d����Z�d�d����Z �d �S)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�������������C���s4���|�j�����t�j�|��|�|���t�j�|��|�|���d��S)N)r\���r,���r����r+���)r@���r7���r����r;���r;���r<���r�������s���� zBufferedRandom.__init__r���c�������������C���s����|�t��k�r�t�d�����n��|��j����|��j�rd�|��j��(�|��j�j�|��j�t�|��j���d���Wd��QXn��|��j�j�|�|���}�|��j���|��j ����Wd��QX|�d�k��r��t �d�����n��|�S)Nzinvalid whence valuer���r���z seek() returned invalid position)r����r���rW���r����r����r7���rQ���r����r���r����r(���)r@���rR���rS���r;���r;���r<���rQ������s���� , zBufferedRandom.seekc�������������C���s'���|��j��r�t�j�|����St�j�|����Sd��S)N)r����r+���rT���r,���)r@���r;���r;���r<���rT������s���� zBufferedRandom.tellNc�������������C���s+���|�d��k�r�|��j�����}�n��t�j�|��|���S)N)rT���r+���rU���)r@���rR���r;���r;���r<���rU�����s����zBufferedRandom.truncatec�������������C���s/���|�d��k�r�d�}�n��|��j�����t�j�|��|���S)Nr���r���)rW���r,���rl���)r@���rh���r;���r;���r<���rl��� ��s���� zBufferedRandom.readc�������������C���s���|��j�����t�j�|��|���S)N)rW���r,���r���)r@���r���r;���r;���r<���r�����s���� zBufferedRandom.readintoc�������������C���s���|��j�����t�j�|��|���S)N)rW���r,���rd���)r@���rh���r;���r;���r<���rd�����s���� zBufferedRandom.peekc�������������C���s���|��j�����t�j�|��|���S)N)rW���r,���r����)r@���rh���r;���r;���r<���r������s���� zBufferedRandom.read1c�������������C���sY���|��j��rI�|��j��2�|��j�j�|��j�t�|��j����d���|��j����Wd��QXn��t�j�|��|���S)Nr���) r����r����r7���rQ���r����r���r����r+���rx���)r@���r���r;���r;���r<���rx�����s ���� #zBufferedRandom.write)rD���rE���rF���r?���r#���r����rQ���rT���rU���rl���r���rd���r����rx���r;���r;���r;���r<���r*������s���r*���c���������������@���s����e��Z�d��Z�d�Z�d�d�d���Z�d�d����Z�d�d�d ���Z�d �d����Z�d�d ����Z�e �d�d������Z �e �d�d������Z�e �d�d������Z�d�S)� TextIOBasez�Base class for text I/O. This class provides a character and line based interface to stream I/O. There is no readinto method because Python's character strings are immutable. There is no public constructor. r���c�������������C���s���|��j��d���d�S)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. rl���N)rP���)r@���rh���r;���r;���r<���rl���-��s����zTextIOBase.readc�������������C���s���|��j��d���d�S)z.Write string s to stream and returning an int.rx���N)rP���)r@����sr;���r;���r<���rx���7��s����zTextIOBase.writeNc�������������C���s���|��j��d���d�S)z*Truncate size to pos, where pos is an int.rU���N)rP���)r@���rR���r;���r;���r<���rU���;��s����zTextIOBase.truncatec�������������C���s���|��j��d���d�S)z_Read until newline or EOF. Returns an empty string if EOF is hit immediately. ro���N)rP���)r@���r;���r;���r<���ro���?��s����zTextIOBase.readlinec�������������C���s���|��j��d���d�S)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����N)rP���)r@���r;���r;���r<���r����F��s����zTextIOBase.detachc�������������C���s���d�S)zSubclasses should override.Nr;���)r@���r;���r;���r<���r2���O��s����zTextIOBase.encodingc�������������C���s���d�S)z�Line endings translated so far. Only line endings translated during reading are considered. Subclasses should override. Nr;���)r@���r;���r;���r<����newlinesT��s����zTextIOBase.newlinesc�������������C���s���d�S)zMError setting of the decoder or encoder. Subclasses should override.Nr;���)r@���r;���r;���r<���r3���^��s����zTextIOBase.errorsr���) rD���rE���rF���r?���rl���rx���rU���ro���r����rz���r2���r����r3���r;���r;���r;���r<���r����$��s��� r����c���������������@���s|���e��Z�d��Z�d�Z�d�d�d���Z�d�d�d���Z�d�d ����Z�d �d����Z�d�d ����Z�d�Z �d�Z �d�Z�e�d�d������Z �d�S)�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. �strictc�������������C���s>���t��j�j�|��d�|��|�|��_�|�|��_�d�|��_�d�|��_�d��S)Nr3���r���F)�codecs�IncrementalDecoderr����� translate�decoder�seennl� pendingcr)r@���r����r����r3���r;���r;���r<���r����o��s ���� z"IncrementalNewlineDecoder.__init__Fc�������������C���s:��|��j��d��k�r�|�}�n�|��j��j�|�d�|��}�|��j�r[�|�sE�|�r[�d�|�}�d�|��_�n��|�j�d���r��|�r��|�d��d���}�d�|��_�n��|�j�d���}�|�j�d���|�}�|�j�d���|�}�|��j�|�o��|��j�|�o��|��j�B|�o��|��j�BO_�|��j �r6|�r|�j �d�d���}�n��|�r6|�j �d�d���}�q6n��|�S) N�final� Fr���Tz � r���)r�����decoder����rm����countr�����_LF�_CR�_CRLFr�����replace)r@����inputr�����outputZcrlfZcrZlfr;���r;���r<���r����v��s(���� + z IncrementalNewlineDecoder.decodec�������������C���s]���|��j��d��k�r�d�}�d�}�n�|��j��j����\�}�}�|�d�K}�|��j�rS�|�d�O}�n��|�|�f�S)Nr����r���r���)r�����getstater����)r@���r�����flagr;���r;���r<���r�������s���� z"IncrementalNewlineDecoder.getstatec�������������C���sO���|�\�}�}�t��|�d�@��|��_�|��j�d��k �rK�|��j�j�|�|�d�?f���n��d��S)Nr���)�boolr����r�����setstate)r@����stater����r����r;���r;���r<���r�������s����z"IncrementalNewlineDecoder.setstatec�������������C���s5���d�|��_��d�|��_�|��j�d��k �r1�|��j�j����n��d��S)Nr���F)r����r����r�����reset)r@���r;���r;���r<���r�������s���� zIncrementalNewlineDecoder.resetr���r�������c���������� ���C���s���d�|��j��S) Nr����r����� �r����r�����r����r�����r����r�����r����r����r����)Nr����r����r����r����r����r����r����)r����)r@���r;���r;���r<���r�������s�����������z"IncrementalNewlineDecoder.newlinesN)rD���rE���rF���r?���r����r����r����r����r����r����r����r����rz���r����r;���r;���r;���r<���r����h��s���r����c���������������@���s���e��Z�d��Z�d�Z�d�Z�d�d�d�d�d�d�d���Z�d�d����Z�e�d �d ������Z�e�d�d������Z �e�d �d������Z �e�d�d������Z�d�d����Z�d�d����Z �d�d����Z�d�d����Z�d�d����Z�e�d�d������Z�e�d�d������Z�d�d ����Z�d!�d"����Z�d#�d$����Z�d%�d&����Z�d'�d(����Z�d)�d*����Z�d�d+�d,���Z�d-�d.����Z�d/�d0����Z�d1�d1�d1�d1�d2�d3���Z�d4�d5����Z�d6�d7����Z�d�d8�d9���Z�d:�d;����Z �d1�d<�d=���Z!�d�d>�d?���Z"�d@�dA����Z#�d�dB�dC���Z$�e�dD�dE������Z%�d�S)Fr-���a��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.getpreferredencoding(False). 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. i���NFc������� ������C���s���|�d��k �r8�t��|�t���r8�t�d�t�|���f�����n��|�d�k�rZ�t�d�|�f�����n��|�d��k�r��y�t�j�|�j������}�Wn�t�t �f�k �r��Yn�X|�d��k�r��y�d�d��l �}�Wn�t�k �r��d�}�Yq��X|�j�d ���}�q��n��t��|�t���st�d �|�����n��t �j�|���j�s3d�}�t�|�|�����n��|�d��k�rHd�}�n"�t��|�t���sjt�d �|�����n��|�|��_�|�|��_�|�|��_�|�|��_�|�|��_�|�d��k�|��_�|�|��_�|�d�k�|��_�|�p�t�j�|��_�d��|��_�d��|��_�d�|��_�d�|��_�d��|��_�|��j �j!����|��_"�|��_#�t$�|��j �d���|��_%�d�|��_&�|��j"�r�|��j'����r�|��j �j(����} �| �d�k�r�y�|��j)����j*�d���Wq�t�k �r�Yq�Xq�n��d��S)Nzillegal newline type: %rr���r����r����� zillegal newline value: %rr����asciiFzinvalid encoding: %rzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsr����zinvalid errors: %rr����g��������)Nr���r����r����r����)+r���r���r����typer���r$����device_encodingr&���r)���rL����locale�ImportError�getpreferredencodingr�����lookup�_is_text_encoding�LookupErrorr�����_line_buffering� _encoding�_errors�_readuniversal�_readtranslate�_readnl�_writetranslate�linesep�_writenl�_encoder�_decoder�_decoded_chars�_decoded_chars_used� _snapshotr:���rZ���� _seekable�_tellingrj���� _has_read1� _b2cratior_���rT����_get_encoderr����) r@���r:���r2���r3���r4���r9���Z write_throughr����r[����positionr;���r;���r<���r�������s`���� zTextIOWrapper.__init__c�������������C���s����d�}�y �|��j��}�Wn�t�k �r'�Yn�X|�d�j�|���7}�y �|��j�}�Wn�t�k �r\�Yn�X|�d�j�|���7}�|�d�j�|��j���S)Nz<_pyio.TextIOWrapperz name={0!r}z mode={0!r}z encoding={0!r}>)rO���r����r����r.���r2���)r@���r8���rO���r.���r;���r;���r<���r���� ��s���� zTextIOWrapper.__repr__c�������������C���s���|��j��S)N)r����)r@���r;���r;���r<���r2���0��s����zTextIOWrapper.encodingc�������������C���s���|��j��S)N)r����)r@���r;���r;���r<���r3���4��s����zTextIOWrapper.errorsc�������������C���s���|��j��S)N)r����)r@���r;���r;���r<���r9���8��s����zTextIOWrapper.line_bufferingc�������������C���s���|��j��S)N)r����)r@���r;���r;���r<���r:���<��s����zTextIOWrapper.bufferc�������������C���s���|��j��r�t�d�����n��|��j�S)NzI/O operation on closed file.)ra���r���r����)r@���r;���r;���r<���rZ���@��s���� zTextIOWrapper.seekablec�������������C���s ���|��j��j����S)N)r:���r]���)r@���r;���r;���r<���r]���E��s����zTextIOWrapper.readablec�������������C���s ���|��j��j����S)N)r:���r_���)r@���r;���r;���r<���r_���H��s����zTextIOWrapper.writablec�������������C���s���|��j��j����|��j�|��_�d��S)N)r:���rW���r����r����)r@���r;���r;���r<���rW���K��s���� zTextIOWrapper.flushc���������� ���C���s?���|��j��d��k �r;�|��j�r;�z�|��j����Wd��|��j��j����Xn��d��S)N)r:���ra���rW���r/���)r@���r;���r;���r<���r/���O��s����zTextIOWrapper.closec�������������C���s ���|��j��j�S)N)r:���ra���)r@���r;���r;���r<���ra���V��s����zTextIOWrapper.closedc�������������C���s ���|��j��j�S)N)r:���rO���)r@���r;���r;���r<���rO���Z��s����zTextIOWrapper.namec�������������C���s ���|��j��j����S)N)r:���r&���)r@���r;���r;���r<���r&���^��s����zTextIOWrapper.filenoc�������������C���s ���|��j��j����S)N)r:���r"���)r@���r;���r;���r<���r"���a��s����zTextIOWrapper.isattyc�������������C���s"��|��j��r�t�d�����n��t�|�t���s@�t�d�|�j�j�����n��t�|���}�|��j�s^�|��j �og�d�|�k�}�|�r��|��j�r��|��j �d�k�r��|�j�d�|��j ���}�n��|��j�p��|��j ����}�|�j�|���}�|��j�j�|���|��j �r��|�s��d�|�k�r��|��j����n��d�|��_�|��j�r|��j�j����n��|�S)zWrite data, where s is a strzwrite to closed filezcan't write %s to text streamr����r����N)ra���r���r���r���r���rN���rD���r���r����r����r����r����r����r�����encoder:���rx���rW���r����r����r����)r@���r����ZlengthZhaslf�encoderr���r;���r;���r<���rx���d��s$���� zTextIOWrapper.writec�������������C���s+���t��j�|��j���}�|�|��j���|��_�|��j�S)N)r�����getincrementalencoderr����r����r����)r@���Zmake_encoderr;���r;���r<���r����z��s����zTextIOWrapper._get_encoderc�������������C���sL���t��j�|��j���}�|�|��j���}�|��j�r?�t�|�|��j���}�n��|�|��_�|�S)N)r�����getincrementaldecoderr����r����r����r����r����r����)r@���Zmake_decoderr����r;���r;���r<����_get_decoder��s���� zTextIOWrapper._get_decoderc�������������C���s���|�|��_��d�|��_�d�S)zSet the _decoded_chars buffer.r���N)r����r����)r@����charsr;���r;���r<����_set_decoded_chars���s���� z TextIOWrapper._set_decoded_charsc�������������C���s[���|��j��}�|�d�k�r+�|��j�|�d���}�n�|��j�|�|�|���}�|��j��t�|���7_��|�S)z'Advance into the _decoded_chars buffer.N)r����r����r���)r@���rg����offsetr����r;���r;���r<����_get_decoded_chars���s���� z TextIOWrapper._get_decoded_charsc�������������C���s1���|��j��|�k��r�t�d�����n��|��j��|�8_��d�S)z!Rewind the _decoded_chars buffer.z"rewind decoded_chars out of boundsN)r�����AssertionError)r@���rg���r;���r;���r<����_rewind_decoded_chars���s����z#TextIOWrapper._rewind_decoded_charsc�������������C���s����|��j��d�k�r�t�d�����n��|��j�r?�|��j��j����\�}�}�n��|��j�r`�|��j�j�|��j���}�n�|��j�j�|��j���}�|�}�|��j��j �|�|���}�|��j �|���|�r��t�|���t�|��j���|��_ �n �d�|��_ �|��j�r��|�|�|�f�|��_�n��|�S)zQ Read and decode the next chunk of data from the BufferedReader. Nz no decoderg��������)r����r���r����r����r����r:���r�����_CHUNK_SIZErl���r����r����r���r����r����r����)r@���� dec_buffer� dec_flags�input_chunk�eofZ decoded_charsr;���r;���r<����_read_chunk���s ���� zTextIOWrapper._read_chunkr���c�������������C���s*���|�|�d�>B|�d�>B|�d�>Bt��|���d�>BS)N�@���������������)r����)r@���r����r���� bytes_to_feed�need_eof� chars_to_skipr;���r;���r<����_pack_cookie���s����zTextIOWrapper._pack_cookiec�������������C���sg���t��|�d���\�}�}�t��|�d���\�}�}�t��|�d���\�}�}�t��|�d���\�}�}�|�|�|�|�|�f�S)Nr���r��l������������l������������l������������l������������)�divmod)r@���Zbigint�restr����r���r��r ��r ��r;���r;���r<����_unpack_cookie���s ����zTextIOWrapper._unpack_cookiec�������������C���s.��|��j��s�t�d�����n��|��j�s0�t�d�����n��|��j����|��j�j����}�|��j�}�|�d��k�sm�|��j�d��k�r��|��j �r��t �d�����n��|�S|��j�\�}�}�|�t�|���8}�|��j�}�|�d�k�r��|��j �|�|���S|�j����}�z@t�|��j�|���}�d�}�|�t�|���k�s t ���x��|�d�k�r�|�j�d�|�f���t�|�j�|�d��|�������} �| �|�k�r�|�j����\�} �}�| �s�|�}�|�| �8}�Pn��|�t�| ���8}�d�}�q|�|�8}�|�d�}�qWd�}�|�j�d�|�f���|�|�}�|�} �|�d�k�r�|��j �|�| ���Sd�}�d�}�d�}�x��t�|�t�|�����D]��}�|�d�7}�|�t�|�j�|�|�|�d�������7}�|�j����\�}�}�|�r�|�|�k�r�|�|�7}�|�|�8}�|�d�d�} �}�}�n��|�|�k�r$Pq$q$W|�t�|�j�d�d�d ����7}�d�}�|�|�k��r�t�d �����n��|��j �|�| �|�|�|���SWd��|�j�|���Xd��S)Nz!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textr���r���r����r���r����Tz'can't reconstruct logical file position)r����rL���r����r(���rW���r:���rT���r����r����r����r����r���r����r��r����r���r����r����r�����range)r@���r����r����r���Z next_inputr ��Zsaved_stateZ skip_bytesZ skip_backrg���r����d� start_posZstart_flagsZ bytes_fedr ��Z chars_decoded�ir����r;���r;���r<���rT������sx���� ' zTextIOWrapper.tellc�������������C���s5���|��j�����|�d��k�r%�|��j����}�n��|��j�j�|���S)N)rW���rT���r:���rU���)r@���rR���r;���r;���r<���rU���=��s���� zTextIOWrapper.truncatec�������������C���s>���|��j��d��k�r�t�d�����n��|��j����|��j�}�d��|��_�|�S)Nzbuffer is already detached)r:���r���rW���r����)r@���r:���r;���r;���r<���r����C��s���� zTextIOWrapper.detachc����������������s������f�d�d����}����j��r*�t�d�����n�����j�sB�t�d�����n��|�d�k�r~�|�d�k�ri�t�d�����n��d�}����j����}�n��|�d�k�r|�d�k�r��t�d �����n�����j�������j�j�d�d���}����j�d ���d�����_ ����j �r�����j �j����n��|�|���|�S|�d�k�r#t�d�|�f�����n��|�d�k��rEt�d�|�f�����n�����j�������j�|���\�}�}�}�}�} ����j�j�|������j�d ���d�����_ �|�d�k�r����j �r����j �j����nU����j �s�|�s�| �r ���j �p����j �������_ ����j �j�d �|�f���|�d �f����_ �n��| �r����j�j�|���} ����j����j �j�| �|�����|�| �f����_ �t����j���| �k��rtt�d�����n��| ����_�n��|�|���|�S)Nc����������������sX���y����j��p����j����}�Wn�t�k �r-�Yn'�X|��d�k�rJ�|�j�d���n �|�j����d�S)z9Reset the encoder (merely useful for proper BOM handling)r���N)r����r����r����r����r����)r����r����)r@���r;���r<����_reset_encoderL��s���� z*TextIOWrapper.seek.<locals>._reset_encoderztell on closed filez!underlying stream is not seekabler���r���z#can't do nonzero cur-relative seeksr���z#can't do nonzero end-relative seeksr���zunsupported whence (%r)znegative seek position %rr����z#can't restore logical file position)ra���r���r����rL���rT���rW���r:���rQ���r����r����r����r����r��r����r����rl���r����r���r����r(���r����)r@���ZcookierS���r��r����r��r���r��r ��r ��r��r;���)r@���r<���rQ���K��s\���� zTextIOWrapper.seekc�������������C���s+��|��j�����|�d��k�r�d�}�n��|��j�p1�|��j����}�y�|�j�Wn4�t�k �ru�}�z�t�d���|���WYd��d��}�~�Xn�X|�d�k��r��|��j����|�j�|��j�j ����d�d��}�|��j �d���d��|��_�|�Sd�}�|��j�|���}�xG�t�|���|�k��r"|�r"|��j ����}�|�|��j�|�t�|�����7}�q��W|�Sd��S) Nr���zan integer is requiredr���r����Tr���Fr���)r^���r����r����r~���r)���r���r����r����r:���rl���r����r����r���r��)r@���rh���r����r����r8���r��r;���r;���r<���rl������s(���� " !zTextIOWrapper.readc�������������C���s=���d�|��_��|��j����}�|�s9�d��|��_�|��j�|��_��t���n��|�S)NF)r����ro���r����r����rq���)r@���rr���r;���r;���r<���rs������s���� zTextIOWrapper.__next__c�������������C���s���|��j��r�t�d�����n��|�d��k�r-�d �}�n�t�|�t���sK�t�d�����n��|��j����}�d�}�|��j�ss�|��j����n��d��}�}�x�|��j�r��|�j �d�|���}�|�d�k�r��|�d�}�Pq�t �|���}�n��|��j�r�|�j �d�|���}�|�j �d�|���}�|�d �k�r&|�d�k�rt �|���}�q�|�d�}�Pq�|�d�k�r@|�d�}�Pq�|�|�k��rZ|�d�}�Pq�|�|�d�k�rx|�d�}�Pq�|�d�}�Pn5�|�j �|��j���}�|�d�k�r�|�t �|��j���}�Pn��|�d�k�r�t �|���|�k�r�|�}�Pn��x�|��j ����r|��j�r�Pq�q�W|��j�r|�|��j����7}�q��|��j�d���d��|��_�|�Sq��W|�d�k�r^|�|�k�r^|�}�n��|��j�t �|���|���|�d��|���S) Nzread from closed filer���zsize must be an integerr���r����r����r���r���r���r���r���r���)ra���r���r���r���r���r����r����r����r����re���r���r����r����r��r����r����r����r����)r@���rh���rr����startrR����endposZnlposZcrposr;���r;���r<���ro������sp���� zTextIOWrapper.readlinec�������������C���s���|��j��r�|��j��j�Sd��S)N)r����r����)r@���r;���r;���r<���r������s����zTextIOWrapper.newlines)&rD���rE���rF���r?���r����r����r����rz���r2���r3���r9���r:���rZ���r]���r_���rW���r/���ra���rO���r&���r"���rx���r����r����r����r����r����r��r��r��rT���rU���r����rQ���rl���rs���ro���r����r;���r;���r;���r<���r-������sH��� E * cK Xr-���c�������������������sv���e��Z�d��Z�d�Z�d�d����f�d�d���Z�d�d����Z�d�d ����Z�e�d �d������Z�e�d�d ������Z �d�d����Z ����S)�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. r���r����c����������������s����t��t�|����j�t����d�d�d�d�d�|��|�d��k�rC�d�|��_�n��|�d��k �r��t�|�t���s�t�d�j�t �|���j �������n��|��j�|���|��j�d���n��d��S) Nr2���zutf-8r3���� surrogatepassr4���Fz*initial_value must be str or None, not {0}r���) r����r��r����r����r����r���r���r���r����r����rD���rx���rQ���)r@���Z initial_valuer4���)rN���r;���r<���r������s���� zStringIO.__init__c�������������C���sj���|��j�����|��j�p�|��j����}�|�j����}�|�j����z �|�j�|��j�j����d�d��SWd��|�j�|���Xd��S)Nr����T) rW���r����r����r����r����r����r:���r����r����)r@���r����Z old_stater;���r;���r<���r����,��s���� zStringIO.getvaluec�������������C���s ���t��j�|����S)N)�objectr����)r@���r;���r;���r<���r����6��s����zStringIO.__repr__c�������������C���s���d��S)Nr;���)r@���r;���r;���r<���r3���;��s����zStringIO.errorsc�������������C���s���d��S)Nr;���)r@���r;���r;���r<���r2���?��s����zStringIO.encodingc�������������C���s���|��j��d���d��S)Nr����)rP���)r@���r;���r;���r<���r����C��s����zStringIO.detach)rD���rE���rF���r?���r����r����r����rz���r3���r2���r����r;���r;���)rN���r<���r����s��� r��)/r?���r$����abcr����r�����_threadr���r����r����Z _dummy_thread�ior���r���r���r���r����rj����addr ���� SEEK_DATAr#���r����r=���r>���rG���rL���r)���r���r(����ABCMetarM����registerr|����_ior!���r����r����r����r,���r+���r����r*���r����r����r����r-���r��r;���r;���r;���r<����<module>���s\��� " � ��< Vn~�YFFAU����Z