选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
a ´i„lã@szdZddlZddlZddlZddlZddlZddlZddlmZ ej dvrXddl m Z ndZ ddlZddlmZmZmZmZhd£Zeedƒr¦e ej¡e ej¡d ZeZeed ƒp¾ejjZeZd6dd„Zdd„Zz ej Z Wne!�yøeZ Yn0Gdd„dƒZ"Gdd„dƒZ#z ej$Z$Wn&e!�yFGdd„de%e&ƒZ$Yn0Gdd„dej'd�Z(ej( )e(¡Gdd„de(ƒZ*ej* )e*¡ddl+m,Z,e* )e,¡Gdd„de(ƒZ-ej- )e-¡Gd d!„d!e-ƒZ.Gd"d#„d#e-ƒZ/Gd$d%„d%e.ƒZ0Gd&d'„d'e.ƒZ1Gd(d)„d)e-ƒZ2Gd*d+„d+e1e0ƒZ3Gd,d-„d-e*ƒZ,Gd.d/„d/e(ƒZ4ej4 )e4¡Gd0d1„d1ej5ƒZ6Gd2d3„d3e4ƒZ7Gd4d5„d5e7ƒZ8dS)7z) Python implementation of the io module. éN)Ú allocate_lock>Úwin32Úcygwin)Úsetmode)Ú__all__ÚSEEK_SETÚSEEK_CURÚSEEK_END>rééÚ SEEK_HOLEi ZgettotalrefcountÚréÿÿÿÿTc Cs¤t|tƒst |¡}t|tttfƒs0td|ƒ‚t|tƒsFtd|ƒ‚t|tƒs\td|ƒ‚|durzt|tƒsztd|ƒ‚|dur˜t|tƒs˜td|ƒ‚t|ƒ}|tdƒs¼t|ƒt|ƒkrÈt d|ƒ‚d|v} d |v} d |v} d |v} d |v} d |v}d|v}d|v�rD| �s"| �s"| �s"| �r*t dƒ‚ddl }|  dt d¡d} |�rX|�rXt dƒ‚| | | | dk�rvt dƒ‚| �s–| �s–| �s–| �s–t dƒ‚|�r®|du�r®t dƒ‚|�rÆ|du�rÆt dƒ‚|�rÞ|du�rÞt dƒ‚|�r|dk�rddl }|  dt d¡t|| �rd�pd| �r"d �p$d| �r2d �p4d| �rBd �pDd| �rRd �pTd||d�}|}�z"d}|dk�sŠ|dk�r’| ¡�r’d }d}|dk�rÜt}zt | ¡¡j}Wnttf�yÌYn0|dk�rÜ|}|dk�rît d!ƒ‚|dk�r |�r|WSt d"ƒ‚| �rt||ƒ}n<| �s0| �s0| �r 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+tUÚxr ÚwÚaú+ÚtÚbÚUz4mode U cannot be combined with 'x', 'w', 'a', or '+'rz'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 argumentzaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be usedÚ)ÚopenerFrzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r)Ú isinstanceÚintÚosÚfspathÚstrÚbytesÚ TypeErrorÚsetÚlenÚ ValueErrorÚwarningsÚwarnÚDeprecationWarningÚRuntimeWarningÚFileIOÚisattyÚDEFAULT_BUFFER_SIZEÚfstatÚfilenoÚ st_blksizeÚOSErrorÚAttributeErrorÚBufferedRandomÚBufferedWriterÚBufferedReaderÚ TextIOWrapperÚmodeÚclose)Úfiler4Ú bufferingÚencodingÚerrorsÚnewlineÚclosefdrZmodesZcreatingÚreadingÚwritingZ appendingZupdatingÚtextÚbinaryr$ÚrawÚresultÚline_bufferingÚbsÚbuffer©rEú/usr/lib64/python3.9/_pyio.pyÚopen+sÀ{           ÿ þÿþýüú        rGcCs ddl}| dtd¡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)r$r%r'rG)Úpathr$rErErFÚ_open_code_with_warnings ÿrJc@seZdZdZddd„ZdS)Ú DocDescriptorz%Helper for builtins.open.__doc__ NcCs dtjS)Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True) )rGÚ__doc__)ÚselfÚobjÚtyprErErFÚ__get__sþÿzDocDescriptor.__get__)N)Ú__name__Ú __module__Ú __qualname__rLrPrErErErFrKsrKc@seZdZdZeƒZdd„ZdS)Ú 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/pylifecycle.c. cOst|i|¤ŽS©N)rG)ÚclsÚargsÚkwargsrErErFÚ__new__.szOpenWrapper.__new__N)rQrRrSrLrKrYrErErErFrT$srTc@s eZdZdS)ÚUnsupportedOperationN)rQrRrSrErErErFrZ7srZc@sèeZdZdZdd„Zd6dd„Zdd„Zd7d d „Zd d „ZdZ dd„Z dd„Z dd„Z d8dd„Z dd„Zd9dd„Zdd„Zd:dd„Zedd „ƒZd;d!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„ZdÚ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!') cCstd|jj|fƒ‚dS)z@Internal: raise an OSError exception for unsupported operations.z%s.%s() not supportedN)rZÚ __class__rQ)rMÚnamerErErFÚ _unsupported]s ÿzIOBase._unsupportedrcCs| d¡dS)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©r^©rMÚposÚwhencerErErFr_dsz IOBase.seekcCs | dd¡S)z5Return an int indicating the current stream position.rr )r_©rMrErErFÚtelltsz IOBase.tellNcCs| d¡dS)zŒTruncate file to size bytes. Size defaults to the current IO position as reported by tell(). Return the new size. ÚtruncateNr`©rMrbrErErFrfxszIOBase.truncatecCs | ¡dS)zuFlush write buffers, if applicable. This is not implemented for read-only and non-blocking streams. N©Ú _checkClosedrdrErErFÚflush‚sz IOBase.flushFcCs&|js"z| ¡Wd|_nd|_0dS)ziFlush and close the IO object. This method has no effect if the file is already closed. TN)Ú_IOBase__closedrjrdrErErFr5Œs z IOBase.closecCsTz |j}WntyYdS0|r(dStr6| ¡nz | ¡Wn Yn0dS)zDestructor. Calls close().N)Úclosedr/Ú_IOBASE_EMITS_UNRAISABLEr5)rMrlrErErFÚ__del__—s    zIOBase.__del__cCsdS)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(). FrErdrErErFÚseekable²szIOBase.seekablecCs | ¡st|durdn|ƒ‚dS)zEInternal: raise UnsupportedOperation if file is not seekable NzFile or stream is not seekable.)rorZ©rMÚmsgrErErFÚ_checkSeekableºs ÿÿzIOBase._checkSeekablecCsdS)zvReturn a bool indicating whether object was opened for reading. If False, read() will raise OSError. FrErdrErErFÚreadableÁszIOBase.readablecCs | ¡st|durdn|ƒ‚dS)zEInternal: raise UnsupportedOperation if file is not readable NzFile or stream is not readable.)rsrZrprErErFÚ_checkReadableÈs ÿÿzIOBase._checkReadablecCsdS)z†Return a bool indicating whether object was opened for writing. If False, write() and truncate() will raise OSError. FrErdrErErFÚwritableÏszIOBase.writablecCs | ¡st|durdn|ƒ‚dS)zEInternal: raise UnsupportedOperation if file is not writable NzFile or stream is not writable.)rurZrprErErFÚ_checkWritableÖs ÿÿzIOBase._checkWritablecCs|jS)z…closed: bool. True iff the file has been closed. For backwards compatibility, this is a property, not a predicate. )rkrdrErErFrlÝsz IOBase.closedcCs|jrt|durdn|ƒ‚dS)z7Internal: raise a ValueError if file is closed NúI/O operation on closed file.©rlr#rprErErFriås ÿÿzIOBase._checkClosedcCs | ¡|S)zCContext management protocol. Returns self (an instance of IOBase).rhrdrErErFÚ __enter__îszIOBase.__enter__cGs | ¡dS)z+Context management protocol. Calls close()N)r5)rMrWrErErFÚ__exit__ószIOBase.__exit__cCs| d¡dS)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,Nr`rdrErErFr,ûsz IOBase.filenocCs | ¡dS)z{Return a bool indicating whether this is an 'interactive' stream. Return False if it can't be determined. FrhrdrErErFr)sz IOBase.isattyrcs¬tˆdƒr‡‡fdd„}ndd„}ˆdur0d‰n2z ˆj}Wn tyZtˆ›d�ƒ‚Yn0|ƒ‰tƒ}ˆdks|t|ƒˆkr¤ˆ |ƒ¡}|sŽq¤||7}| d ¡rhq¤qht|ƒS) 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. Úpeekcs>ˆ d¡}|sdS| d¡dp&t|ƒ}ˆdkr:t|ˆƒ}|S)Nr ó r)r{Úfindr"Úmin)Z readaheadÚn©rMÚsizerErFÚ nreadaheads  z#IOBase.readline..nreadaheadcSsdS©Nr rErErErErFr‚!sNrú is not an integerrr|) ÚhasattrÚ __index__r/r Ú bytearrayr"ÚreadÚendswithr)rMr�r‚Ú size_indexÚresrrEr€rFÚreadline s&      zIOBase.readlinecCs | ¡|SrUrhrdrErErFÚ__iter__6szIOBase.__iter__cCs| ¡}|st‚|SrU)rŒÚ StopIteration©rMÚlinerErErFÚ__next__:szIOBase.__next__cCsP|dus|dkrt|ƒSd}g}|D]&}| |¡|t|ƒ7}||kr$qLq$|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")rMÚhintrÚlinesr�rErErFÚ readlines@s  zIOBase.readlinescCs | ¡|D]}| |¡q dS)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)riÚwrite)rMr•r�rErErFÚ writelinesRszIOBase.writelines)r)N)N)N)N)N)r)N)rQrRrSrLr^r_rerfrjrkr5rnrorrrsrtrurvÚpropertyrlriryrzr,r)rŒr�r‘r–r˜rErErErFr[;s6          * r[)Ú metaclassc@s2eZdZdZd dd„Zdd„Zdd„Zd d „Zd S) Ú RawIOBasezBase class for raw binary I/O.rcCsP|dur d}|dkr| ¡St| ¡ƒ}| |¡}|dur>dS||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. Nrr)Úreadallr‡r†Úreadintor)rMr�rrrErErFrˆms   zRawIOBase.readcCs4tƒ}| t¡}|sq ||7}q|r,t|ƒS|SdS)z+Read until EOF, using multiple read() call.N)r‡rˆr*r)rMr‹ÚdatarErErFrœ~s  zRawIOBase.readallcCs| d¡dS)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�Nr`©rMrrErErFr�ŒszRawIOBase.readintocCs| d¡dS)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—Nr`rŸrErErFr—”szRawIOBase.writeN)r)rQrRrSrLrˆrœr�r—rErErErFr›_s  r›)r(c@sLeZdZdZddd„Zddd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dS)Ú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. rcCs| d¡dS)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ˆNr`r€rErErFrˆ²szBufferedIOBase.readcCs| d¡dS)zaRead up to size bytes with at most one read() system call, where size is an int. Úread1Nr`r€rErErFr¡ÆszBufferedIOBase.read1cCs|j|dd�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ŸrErErFr�Ìs zBufferedIOBase.readintocCs|j|dd�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ŸrErErFÚ readinto1Ús zBufferedIOBase.readinto1cCsVt|tƒst|ƒ}| d¡}|r0| t|ƒ¡}n| t|ƒ¡}t|ƒ}||d|…<|S)NÚB)rÚ memoryviewÚcastr¡r"rˆ)rMrr¡ržrrErErFr¤ås   zBufferedIOBase._readintocCs| d¡dS)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—Nr`rŸrErErFr—ôs zBufferedIOBase.writecCs| d¡dS)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. ÚdetachNr`rdrErErFr©ÿszBufferedIOBase.detachN)r)r) rQrRrSrLrˆr¡r�r¥r¤r—r©rErErErFr ¡s    r c@s¤eZdZdZdd„Zd$dd„Zdd„Zd%d d „Zd d „Zdd„Z dd„Z dd„Z e dd„ƒZ e dd„ƒZe dd„ƒZe dd„ƒZdd„Zdd„Zd d!„Zd"d#„Zd 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(). cCs ||_dSrU©Ú_raw©rMr@rErErFÚ__init__sz_BufferedIOMixin.__init__rcCs"|j ||¡}|dkrtdƒ‚|S)Nrz#seek() returned an invalid position)r@r_r.)rMrbrcZ new_positionrErErFr_sz_BufferedIOMixin.seekcCs|j ¡}|dkrtdƒ‚|S)Nrz#tell() returned an invalid position)r@rer.rgrErErFres z_BufferedIOMixin.tellNcCs4| ¡| ¡| ¡|dur(| ¡}|j |¡SrU)rirvrjrer@rfrgrErErFrf%s z_BufferedIOMixin.truncatecCs|jrtdƒ‚|j ¡dS)Núflush on closed file)rlr#r@rjrdrErErFrj6sz_BufferedIOMixin.flushcCs8|jdur4|js4z| ¡W|j ¡n |j ¡0dSrU)r@rlrjr5rdrErErFr5;s z_BufferedIOMixin.closecCs*|jdurtdƒ‚| ¡|j}d|_|S)Nzraw stream already detached)r@r#rjr¬r­rErErFr©Cs  z_BufferedIOMixin.detachcCs |j ¡SrU)r@rordrErErFroMsz_BufferedIOMixin.seekablecCs|jSrUr«rdrErErFr@Psz_BufferedIOMixin.rawcCs|jjSrU)r@rlrdrErErFrlTsz_BufferedIOMixin.closedcCs|jjSrU)r@r]rdrErErFr]Xsz_BufferedIOMixin.namecCs|jjSrU)r@r4rdrErErFr4\sz_BufferedIOMixin.modecCstd|jj›d�ƒ‚dS©Nzcannot pickle z object©r r\rQrdrErErFÚ __getstate__`sz_BufferedIOMixin.__getstate__cCsL|jj}|jj}z |j}Wnty8d ||¡YS0d |||¡SdS)Nz<{}.{}>z<{}.{} name={!r}>)r\rRrSr]r/Úformat)rMÚmodnameZclsnamer]rErErFÚ__repr__cs  z_BufferedIOMixin.__repr__cCs |j ¡SrU)r@r,rdrErErFr,osz_BufferedIOMixin.filenocCs |j ¡SrU)r@r)rdrErErFr)rsz_BufferedIOMixin.isatty)r)N)rQrRrSrLr®r_rerfrjr5r©ror™r@rlr]r4r²rµr,r)rErErErFrª s*        rªcs–eZdZdZdZd!dd„Zdd„Zdd„Zd d „Z‡fd d „Z d"dd„Z d#dd„Z dd„Z d$dd„Z dd„Zd%dd„Zdd„Zdd„Zdd „Z‡ZS)&ÚBytesIOz0YdS)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. Nrzinvalid number of bytes to read)r#rÓÚ_read_unlockedr€rErErFrˆ$szBufferedReader.readc Cs†d}d}|j}|j}|dus$|dkrº| ¡t|jdƒrj|j ¡}|durZ||d…pXdS||d…|S||d…g}d}|j ¡}||vr”|}q¬|t|ƒ7}| |¡q|d  |¡p¸|St|ƒ|} || krì|j|7_||||…S||d…g}t |j |ƒ} | |k�rH|j | ¡}||v�r.|}�qH| t|ƒ7} | |¡�qt || ƒ}d  |¡} | |d…|_d|_| �r‚| d|…S|S)NrÃ)rÃNrrœr) rÕrÖrÑr…r@rœrˆr"r“ÚjoinrÊrÐr~) rMrZ nodata_valZ empty_valuesrºrbÚchunkÚchunksZ current_sizeÚavailZwantedÚoutrErErFr×1sL             zBufferedReader._read_unlockedrcCs4|j�| |¡WdƒS1s&0YdS)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_unlockedr€rErErFr{eszBufferedReader.peekcCsrt||jƒ}t|jƒ|j}||ks,|dkrb|j|}|j |¡}|rb|j|jd…||_d|_|j|jd…Sr·)r~rÐr"rÕrÖr@rˆ)rMrZwantZhaveZto_readÚcurrentrErErFrÝos   zBufferedReader._peek_unlockedrcCsj|dkr|j}|dkrdS|j�6| d¡| t|t|jƒ|jƒ¡WdƒS1s\0YdS)zd |_d |_tjtjB}d |v�rTd |_d |_|j�rp|j�rp|tjO}n|j�r„|tjO}n |tjO}|ttddƒO}ttddƒ�p¶ttddƒ}||O}d}�zT|dk�r@|�sàtdƒ‚|du�rút ||d¡}n0|||ƒ}t|tƒ�stdƒ‚|dk�r*tdƒ‚|}|�s@t |d¡||_t |¡} z(t | j¡�rvt t!j"t #t!j"¡|ƒ‚Wnt$�yŒYn0t| ddƒ|_%|j%d k�r®t&|_%t'�rÀt'|tj(ƒ||_)|j�rzt *|dt+¡Wn6t�y} z| j!t!j,k�r‚WYd} ~ n d} ~ 00Wn"|du�r6t |¡‚Yn0||_dS)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). rrz$integer argument expected, got floatznegative file descriptorzinvalid mode: %szxrwab+css|]}|dvVqdS)ZrwaxNrE)Ú.0ÚcrErErFÚ îrÃz"FileIO.__init__..r rzKMust have exactly one of create/read/write/append mode and at most one plusrTr rrÚO_BINARYZ O_NOINHERITÚ O_CLOEXECNz'Cannot use closefd=False with file namei¶zexpected integer from openerzNegative file descriptorFr-)-Ú_fdÚ_closefdrr5rÚfloatr rr#rr!ÚsumÚcountÚ_createdÚ _writableÚO_EXCLÚO_CREATÚ _readableÚO_TRUNCÚ _appendingÚO_APPENDÚO_RDWRÚO_RDONLYÚO_WRONLYÚgetattrrGr.Úset_inheritabler+ÚstatÚS_ISDIRÚst_modeÚIsADirectoryErrorrçZEISDIRrèr/Ú_blksizer*Ú_setmoderõr]Úlseekr ZESPIPE) rMr6r4r;rÚfdÚflagsZnoinherit_flagZowned_fdZfdfstatrêrErErFr®Ìs¬     $        ÿ        ÿ    zFileIO.__init__cCsB|jdkr>|jr>|js>ddl}|jd|ftd|d�| ¡dS)Nrzunclosed file %rr )Ú stacklevelÚsource)r÷rørlr$r%ÚResourceWarningr5)rMr$rErErFrnEs ÿzFileIO.__del__cCstd|jj›d�ƒ‚dSr°r±rdrErErFr²LszFileIO.__getstate__cCsnd|jj|jjf}|jr"d|Sz |j}Wn(tyTd||j|j|jfYS0d|||j|jfSdS)Nz%s.%sz <%s [closed]>z<%s fd=%d mode=%r closefd=%r>z<%s name=%r mode=%r closefd=%r>) r\rRrSrlr]r/r÷r4rø)rMÚ class_namer]rErErFrµOsÿ  ÿ ÿzFileIO.__repr__cCs|jstdƒ‚dS)NzFile not open for reading)rrZrdrErErFrt]szFileIO._checkReadablecCs|jstdƒ‚dS)NzFile not open for writing)rýrZrprErErFrvaszFileIO._checkWritablecCsR| ¡| ¡|dus |dkr(| ¡Szt |j|¡WStyLYdS0dS)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)rirtrœrrˆr÷rær€rErErFrˆes z FileIO.readcCsÚ| ¡| ¡t}z6t |jdt¡}t |j¡j}||krH||d}Wnt y\Yn0t ƒ}t |ƒ|kr†t |ƒ}|t |tƒ7}|t |ƒ}zt  |j|¡}WntyÀ|rºYqÒYdS0|sÈqÒ||7}qdt|ƒS)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. rr N)rirtr*rrr÷rr+Úst_sizer.r‡r"rÊrˆrær)rMÚbufsizerbÚendrArrÙrErErFrœus2     zFileIO.readallcCs4t|ƒ d¡}| t|ƒ¡}t|ƒ}||d|…<|S)zSame as RawIOBase.readinto().r¦N)r§r¨rˆr")rMrÚmržrrErErFr�˜s  zFileIO.readintocCs:| ¡| ¡zt |j|¡WSty4YdS0dS)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)rirvrr—r÷rærŸrErErFr— s  z FileIO.writecCs*t|tƒrtdƒ‚| ¡t |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)rrùr rirrr÷rarErErFr_®s z FileIO.seekcCs| ¡t |jdt¡S)zYtell() -> int. Current file position. Can raise OSError for non seekable files.r)rirrr÷rrdrErErFre¾sz FileIO.tellcCs2| ¡| ¡|dur | ¡}t |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. N)rirvrerÚ ftruncater÷r€rErErFrfÅs zFileIO.truncatecs8|js4z |jrt |j¡Wtƒ ¡n tƒ ¡0dS)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)rlrørr5r÷rÀrdrÁrErFr5Òs z FileIO.closecCsD| ¡|jdur>z | ¡Wnty6d|_Yn0d|_|jS)z$True if file supports random-access.NFT)riÚ _seekablerer.rdrErErFroßs    zFileIO.seekablecCs| ¡|jS)z'True if file was opened in a read mode.)rirrdrErErFrsëszFileIO.readablecCs| ¡|jS)z(True if file was opened in a write mode.)rirýrdrErErFruðszFileIO.writablecCs| ¡|jS)z3Return the underlying file descriptor (an integer).)rir÷rdrErErFr,õsz FileIO.filenocCs| ¡t |j¡S)z.True if the file is connected to a TTY device.)rirr)r÷rdrErErFr)úsz FileIO.isattycCs|jS)z6True if the file descriptor will be closed by close().)rørdrErErFr;ÿszFileIO.closefdcCsJ|jr|jrdSdSn0|jr,|jr&dSdSn|jrB|jr„Z#d?d@„Z$dSdAdB„Z%dCdD„Z&dTdEdF„Z'dUdGdH„Z(dIdJ„Z)dVdKdL„Z*e dMdN„ƒZ+dS)Wr3aCharacter 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. iNFc Cs$| |¡|durrzt | ¡¡}Wnttfy:Yn0|durrz ddl}Wntyfd}Yn 0| d¡}t |t ƒsˆt d|ƒ‚t   |¡js¤d}t||ƒ‚|dur²d}n$t |t ƒsÈt d|ƒ‚trÖt  |¡||_d|_d|_d|_|j ¡|_|_t|jd ƒ|_| |||||¡dS) NrÚasciiFrzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsr#rrr¡)Ú_check_newlinerÚdevice_encodingr,r/rZÚlocaleÚ ImportErrorÚgetpreferredencodingrrr#r$ÚlookupÚ_is_text_encodingÚ LookupErrorÚ _CHECK_ERRORSÚ lookup_errorr¸Ú_decoded_charsÚ_decoded_chars_usedÚ _snapshotrDrorÚ_tellingr…Ú _has_read1Ú _configure) rMrDr8r9r:rBÚ write_throughr@rqrErErFr®Ós@             ÿzTextIOWrapper.__init__cCs>|dur$t|tƒs$tdt|ƒfƒ‚|dvr:td|fƒ‚dS)Nzillegal newline type: %r)Nrr.r,r-zillegal newline value: %r)rrr Útyper#)rMr:rErErFr>ýszTextIOWrapper._check_newlinecCs¢||_||_d|_d|_d|_| |_|du|_||_|dk|_|pHt j |_ ||_ ||_ |jrž| ¡rž|j ¡}|dkržz| ¡ d¡WntyœYn0dS)Nçrr)Ú _encodingÚ_errorsÚ_encoderÚ_decoderÚ _b2cratioÚ_readuniversalÚ_readtranslateÚ_readnlÚ_writetranslaterÚlinesepÚ_writenlÚ_line_bufferingÚ_write_throughrrurDreÚ _get_encoderr9rE)rMr8r9r:rBrNÚpositionrErErFrMs&     zTextIOWrapper._configurecCs|d |jj|jj¡}z |j}Wnty0Yn0|d |¡7}z |j}Wnty\Yn0|d |¡7}|d |j¡S)Nz<{}.{}z name={0!r}z mode={0!r}z encoding={0!r}>)r³r\rRrSr]r/r4r8)rMrAr]r4rErErFrµ's ÿ    zTextIOWrapper.__repr__cCs|jSrU)rQrdrErErFr88szTextIOWrapper.encodingcCs|jSrU)rRrdrErErFr9<szTextIOWrapper.errorscCs|jSrU)r\rdrErErFrB@szTextIOWrapper.line_bufferingcCs|jSrU)r]rdrErErFrNDszTextIOWrapper.write_throughcCs|jSrU)r¸rdrErErFrDHszTextIOWrapper.buffer)r8r9r:rBrNcCsÖ|jdur*|dus"|dus"|tur*tdƒ‚|durH|durB|j}q^d}nt|tƒs^td|ƒ‚|durn|j}nt|tƒs„td|ƒ‚|tur’|j}|  |¡|durª|j }|dur¸|j }|  ¡|  |||||¡dS)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#rr)rTÚEllipsisrZrRrrr rQrXr>rBrNrjrM)rMr8r9r:rBrNrErErFÚ reconfigureLs> ÿÿþÿ      ÿzTextIOWrapper.reconfigurecCs|jrtdƒ‚|jS)Nrw)rlr#rrdrErErFrouszTextIOWrapper.seekablecCs |j ¡SrU)rDrsrdrErErFrszszTextIOWrapper.readablecCs |j ¡SrU)rDrurdrErErFru}szTextIOWrapper.writablecCs|j ¡|j|_dSrU)rDrjrrKrdrErErFrj€s zTextIOWrapper.flushcCs8|jdur4|js4z| ¡W|j ¡n |j ¡0dSrU)rDrlrjr5rdrErErFr5„s zTextIOWrapper.closecCs|jjSrU)rDrlrdrErErFrl‹szTextIOWrapper.closedcCs|jjSrU)rDr]rdrErErFr]�szTextIOWrapper.namecCs |j ¡SrU)rDr,rdrErErFr,“szTextIOWrapper.filenocCs |j ¡SrU)rDr)rdrErErFr)–szTextIOWrapper.isattycCsÈ|jrtdƒ‚t|tƒs(td|jjƒ‚t|ƒ}|js<|j oBd|v}|rf|jrf|j dkrf|  d|j ¡}|j pr|  ¡}| |¡}|j |¡|j r¤|sœd|vr¤| ¡| d¡d|_|jrÄ|j ¡|S)zWrite data, where s is a strrÄzcan't write %s to text streamr.r,rN)rlr#rrr r\rQr"rYr\r[r3rSr^ÚencoderDr—rjÚ_set_decoded_charsrJrTr;)rMr ÚlengthZhaslfÚencoderrrErErFr—™s( ÿ    zTextIOWrapper.writecCst |j¡}||jƒ|_|jSrU)r$ÚgetincrementalencoderrQrRrS)rMZ make_encoderrErErFr^°s  zTextIOWrapper._get_encodercCs2t |j¡}||jƒ}|jr(t||jƒ}||_|SrU)r$ÚgetincrementaldecoderrQrRrVr"rWrT)rMZ make_decoderr'rErErFÚ _get_decoderµs    zTextIOWrapper._get_decodercCs||_d|_dS)zSet the _decoded_chars buffer.rN)rHrI)rMÚcharsrErErFrcÀsz TextIOWrapper._set_decoded_charscCsF|j}|dur|j|d…}n|j|||…}|jt|ƒ7_|S)z'Advance into the _decoded_chars buffer.N)rIrHr")rMrÚoffsetrirErErFÚ_get_decoded_charsÅs z TextIOWrapper._get_decoded_charscCs$|j|krtdƒ‚|j|8_dS)z!Rewind the _decoded_chars buffer.z"rewind decoded_chars out of boundsN)rIÚAssertionErrorrírErErFÚ_rewind_decoded_charsÏs z#TextIOWrapper._rewind_decoded_charscCs¢|jdurtdƒ‚|jr&|j ¡\}}|jr<|j |j¡}n|j |j¡}| }|j  ||¡}|  |¡|r‚t |ƒt |j ƒ|_ nd|_ |jrœ|||f|_| S)zQ Read and decode the next chunk of data from the BufferedReader. Nz no decoderrP)rTr#rKr6rLrDr¡Ú _CHUNK_SIZErˆr/rcr"rHrUrJ)rMÚ dec_bufferÚ dec_flagsÚ input_chunkÚeofZ decoded_charsrErErFÚ _read_chunkÕs  zTextIOWrapper._read_chunkrcCs(||d>B|d>B|d>Bt|ƒd>BS)Né@é€éÀé)r8)rMr_rpÚ bytes_to_feedÚneed_eofÚ chars_to_skiprErErFÚ _pack_cookieÿs ÿ ÿzTextIOWrapper._pack_cookiecCsJt|dƒ\}}t|dƒ\}}t|dƒ\}}t|dƒ\}}|||t|ƒ|fS)Nl)Údivmodr8)rMZbigintÚrestr_rprxryrzrErErFÚ_unpack_cookie s zTextIOWrapper._unpack_cookiec CsP|jstdƒ‚|jstdƒ‚| ¡|j ¡}|j}|dusF|jdurX|j rTt dƒ‚|S|j\}}|t |ƒ8}|j }|dkrˆ|  ||¡S| ¡}�z¬t|j|ƒ}d}|dk�r"| d|f¡t | |d|…¡ƒ} | |k�r| ¡\} } | sþ| }|| 8}�q4|t | ƒ8}d}q¦||8}|d}q¦d}| d|f¡||} |} |dk�rb|  | | ¡W| |¡Sd}d}d}t|t |ƒƒD]x}|d7}|t | |||d…¡ƒ7}| ¡\}}|�sâ||k�râ| |7} ||8}|dd} }}||k�r|�q"�q||t |jdd d �ƒ7}d }||k�r"td ƒ‚|  | | |||¡W| |¡S| |¡0dS) Nú!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textrr rÃr FTr*z'can't reconstruct logical file position)rrZrKr.rjrDrerTrJrHrlr"rIr{r6rrUr9r/Úrange)rMr_r'rpZ next_inputrzÚ saved_stateZ skip_bytesZ skip_backrrÚdÚ start_posZ start_flagsZ bytes_fedryZ chars_decodedÚirorErErFre s€           à     ÿ ýzTextIOWrapper.tellcCs$| ¡|dur| ¡}|j |¡SrU)rjrerDrfrgrErErFrfs szTextIOWrapper.truncatecCs*|jdurtdƒ‚| ¡|j}d|_|S)Nzbuffer is already detached)rDr#rjr¸)rMrDrErErFr©y s  zTextIOWrapper.detachc sćfdd„}ˆjrtdƒ‚ˆjs(tdƒ‚|tkrN|dkr@tdƒ‚d}ˆ ¡}nZ|tkr¨|dkrftdƒ‚ˆ ¡ˆj  d|¡}ˆ  d¡dˆ_ ˆj rœˆj   ¡||ƒ|S|dkr¾td |fƒ‚|dkrÔtd |fƒ‚ˆ ¡ˆ |¡\}}}}} ˆj  |¡ˆ  d¡dˆ_ |dk�r*ˆj �r*ˆj   ¡n@ˆj �s>|�s>| �rjˆj �pLˆ ¡ˆ_ ˆj  d |f¡|d fˆ_ | �r¸ˆj |¡} ˆ  ˆj  | |¡¡|| fˆ_ tˆjƒ| k�r²td ƒ‚| ˆ_||ƒ|S) NcsFzˆjpˆ ¡}Wnty$Yn0|dkr:| d¡n| ¡dS)z9Reset the encoder (merely useful for proper BOM handling)rN)rSr^rEr9r;)r_rerdrErFÚ_reset_encoder‚ s  z*TextIOWrapper.seek.._reset_encoderrÌrrz#can't do nonzero cur-relative seeksz#can't do nonzero end-relative seeksrzunsupported whence (%r)rÉrÃz#can't restore logical file position)rlr#rrZrrer rjrDr_rcrJrTr;r~rhr9rˆr/r"rHr.rI) rMZcookiercr…r_rƒrprxryrzrqrErdrFr_� s`    ÿ       ÿ zTextIOWrapper.seekcCsÖ| ¡|durd}n2z |j}Wn ty@t|›d�ƒ‚Yn0|ƒ}|jpT| ¡}|dkrŽ| ¡|j|j  ¡dd�}|  d¡d|_ |Sd}| |¡}t |ƒ|krÎ|sÎ|  ¡ }|| |t |ƒ¡7}qœ|SdS)Nrr„rTr*rF)rtr†r/r rTrhrkr/rDrˆrcrJr"rs)rMr�rŠr'rArrrErErFrˆÌ s,  ÿ   zTextIOWrapper.readcCs(d|_| ¡}|s$d|_|j|_t‚|S)NF)rKrŒrJrrŽr�rErErFr‘è szTextIOWrapper.__next__c Cs|jrtdƒ‚|durd}n2z |j}Wn tyFt|›d�ƒ‚Yn0|ƒ}| ¡}d}|jsh| ¡d}}|jr¢|  d|¡}|dkr˜|d}�qÒnt |ƒ}nÊ|j �rD|  d|¡}|  d|¡}|dkrê|dkrÜt |ƒ}n |d}�qÒnX|dk�r|d}�qÒn@||k�r|d}�qÒn(||dk�r6|d}�qÒn |d}�qÒn(|  |j ¡}|dk�rl|t |j ƒ}�qÒ|dk�rŒt |ƒ|k�rŒ|}�qÒ|  ¡�r¦|j�rŒ�q¦�qŒ|j�r¼|| ¡7}qp| d ¡d|_|Sqp|dk�rê||k�rê|}| t |ƒ|¡|d|…S) NrÂrr„rr.r r,r r)rlr#r†r/r rkrTrhrWr}r"rVrXrsrHrcrJrm) rMr�rŠr�ÚstartrbÚendposZnlposZcrposrErErFrŒñ st             zTextIOWrapper.readlinecCs|jr|jjSdSrU)rTr!rdrErErFr!N szTextIOWrapper.newlines)NNNFF)NNNFF)N)rrFr)N)r)N)N),rQrRrSrLrnr¸r®r>rMrµr™r8r9rBrNrDr`rarorsrurjr5rlr]r,r)r—r^rhrcrkrmrsr{r~rerfr©r_rˆr‘rŒr!rErErErFr3²snÿ *ÿ $     þ )    *ÿ c  K  ]r3csReZdZdZd‡fdd„ Zdd„Zdd „Zed d „ƒZed d „ƒZ dd„Z ‡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. rr.csftt|ƒjtƒdd|d�|dur(d|_|durbt|tƒsNtd t |ƒj ¡ƒ‚|  |¡|  d¡dS)Nzutf-8Ú surrogatepass)r8r9r:Fz*initial_value must be str or None, not {0}r) rÀrˆr®r¶rYrrr r³rOrQr—r_)rMZ initial_valuer:rÁrErFr®Z sý ÿ zStringIO.__init__c CsX| ¡|jp| ¡}| ¡}| ¡z |j|j ¡dd�W| |¡S| |¡0dS)NTr*) rjrTrhr6r;r/rDr½r9)rMr'Z old_staterErErFr½j s þzStringIO.getvaluecCs t |¡SrU)ÚobjectrµrdrErErFrµt szStringIO.__repr__cCsdSrUrErdrErErFr9y szStringIO.errorscCsdSrUrErdrErErFr8} szStringIO.encodingcCs| d¡dS)Nr©r`rdrErErFr©� szStringIO.detach)rr.) rQrRrSrLr®r½rµr™r9r8r©rÎrErErÁrFrˆS s   rˆ)r rNNNTN)9rLrÚabcr$rçr ÚsysÚ_threadrrÒÚplatformÚmsvcrtrrÚiorrrr rár…Úaddr Ú SEEK_DATAr*rærÚdev_modermrFrGrJÚ open_coder/rKrTrZr.r#ÚABCMetar[Úregisterr›Ú_ior(r rªr¶r2r1rîr0rr%r"r3rˆrErErErFÚs„     ÿ [    # =   g kCiIJY@ U&