grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026 ”qcÜã@sQdZddlZejZGdd„dejƒZGdd„dejƒZdS)z7Internal classes used by the gzip, lzma and bz2 moduleséNc@sFeZdZdZdd„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/python35/lib64/python3.5/_compression.pyÚ_check_not_closed s zBaseStream._check_not_closedcCs|jƒstjdƒ‚dS)NzFile not open for reading)ÚreadableÚioÚUnsupportedOperation)rrrrÚ_check_can_reads zBaseStream._check_can_readcCs|jƒstjdƒ‚dS)NzFile not open for writing)Úwritabler r )rrrrÚ_check_can_writes zBaseStream._check_can_writecCs:|jƒstjdƒ‚|jƒs6tjdƒ‚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    rcs”eZdZdZdd„Zfdd„Z‡fdd†Zdd „Zd d „Zdd d„Z dd„Z e j dd„Z dd„Z‡S)ÚDecompressReaderz5Adapts the decompressor API to a RawIOBase reader APIcCsdS)NTr)rrrrr $szDecompressReader.readablecKsX||_d|_d|_d|_||_||_|j|j�|_||_dS)NFrééÿÿÿÿ)Ú_fpÚ_eofÚ_posÚ_sizeÚ_decomp_factoryÚ _decomp_argsÚ _decompressorÚ_trailing_error)rÚfpZdecomp_factoryZtrailing_errorZ decomp_argsrrrÚ__init__'s      zDecompressReader.__init__csd|_tƒjƒS)N)rÚsuperÚclose)r)Ú __class__rrr#;s zDecompressReader.closecCs |jjƒS)N)rr)rrrrr?szDecompressReader.seekablecCsdt|ƒ�K}|jdƒ�2}|jt|ƒƒ}||dt|ƒ…        zDecompressReader.readcCs;|jjdƒd|_d|_|j|j�|_dS)NrF)rÚseekrrrrr)rrrrÚ_rewindrs  zDecompressReader._rewindcCs|tjkrn{|tjkr1|j|}n\|tjkrx|jdkrhx|jtjƒrgqRW|j|}ntdj |ƒƒ‚||jkr©|j ƒn ||j8}xB|dkrú|jt tj|ƒƒ}|sçP|t |ƒ8}q¹W|jS)NrzInvalid value for whence: {}) r ÚSEEK_SETÚSEEK_CURrÚSEEK_ENDrr(ÚDEFAULT_BUFFER_SIZErÚformatr4Úminr))rÚoffsetÚwhencer+rrrr3xs&  zDecompressReader.seekcCs|jS)z!Return the current file position.)r)rrrrÚtell–szDecompressReader.tellr)rrrrr r!r#rr,r(r4r r5r3r=rr)r$rr!s    * r)rr r8r0ÚBufferedIOBaserÚ RawIOBaserrrrrÚs