grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026B vÌÊl¹ÆµÝã@s:dZddlZejZGdd„dejƒZGdd„dejƒZdS)z7Internal classes used by the gzip, lzma and bz2 moduleséNc@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd S) Ú BaseStreamzMode-checking helper functions.cCs|jrtdƒ‚dS)NzI/O operation on closed file)ÚclosedÚ ValueError)Úself©rú1/opt/alt/python37/lib64/python3.7/_compression.pyÚ_check_not_closed szBaseStream._check_not_closedcCs| ¡st d¡‚dS)NzFile not open for reading)ÚreadableÚioÚUnsupportedOperation)rrrrÚ_check_can_readszBaseStream._check_can_readcCs| ¡st d¡‚dS)NzFile not open for writing)Úwritabler r )rrrrÚ_check_can_writeszBaseStream._check_can_writecCs(| ¡st d¡‚| ¡s$t d¡‚dS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r r r Úseekable)rrrrÚ_check_can_seeks zBaseStream._check_can_seekN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr rrrrrrr s rcsjeZdZdZdd„Zddd„Z‡fdd„Zd d „Zd d „Zddd„Z dd„Z e j fdd„Z dd„Z‡ZS)ÚDecompressReaderz5Adapts the decompressor API to a RawIOBase reader APIcCsdS)NTr)rrrrr $szDecompressReader.readablercKs>||_d|_d|_d|_||_||_|jf|jŽ|_||_dS)NFréÿÿÿÿ)Ú_fpÚ_eofÚ_posÚ_sizeÚ_decomp_factoryÚ _decomp_argsÚ _decompressorÚ_trailing_error)rÚfpZdecomp_factoryZtrailing_errorZ decomp_argsrrrÚ__init__'szDecompressReader.__init__csd|_tƒ ¡S)N)rÚsuperÚclose)r)Ú __class__rrr";szDecompressReader.closecCs |j ¡S)N)rr)rrrrr?szDecompressReader.seekablec CsPt|ƒ�:}| d¡�$}| t|ƒ¡}||dt|ƒ…<WdQRXWdQRXt|ƒS)NÚB)Ú memoryviewÚcastÚreadÚlen)rÚbZviewZ byte_viewÚdatarrrÚreadintoBs$zDecompressReader.readintorcCsî|dkr| ¡S|r|jrdSd}xž|jjr„|jjp>|j t¡}|sFP|jf|j Ž|_y|j  ||¡}Wq¸|j k r€PYq¸Xn4|jj r¦|j t¡}|sªt dƒ‚nd}|j  ||¡}|r$Pq$W|sØd|_|j|_dS|jt|ƒ7_|S)NrózACompressed file ended before the end-of-stream marker was reachedT)ÚreadallrrÚeofZ unused_datarr'Ú BUFFER_SIZErrZ decompressrZ needs_inputÚEOFErrorrrr()rÚsizer*Zrawblockrrrr'Hs>      zDecompressReader.readcCs,|j d¡d|_d|_|jf|jŽ|_dS)NrF)rÚseekrrrrr)rrrrÚ_rewindrs zDecompressReader._rewindcCs¸|tjkr nV|tjkr"|j|}n@|tjkrT|jdkrHx| tj¡rFq8W|j|}ntd  |¡ƒ‚||jkrv|  ¡n ||j8}x0|dkr°| t tj|ƒ¡}|s¢P|t |ƒ8}q‚W|jS)NrzInvalid value for whence: {}) r ÚSEEK_SETÚSEEK_CURrÚSEEK_ENDrr'ÚDEFAULT_BUFFER_SIZErÚformatr3Úminr()rÚoffsetÚwhencer*rrrr2xs&          zDecompressReader.seekcCs|jS)z!Return the current file position.)r)rrrrÚtell–szDecompressReader.tell)r)r)rrrrr r r"rr+r'r3r r4r2r<Ú __classcell__rr)r#rr!s   *r)rr r7r/ÚBufferedIOBaserÚ RawIOBaserrrrrÚs