f1r ddlZddlZejZGddejZGddejZdS)Nc(eZdZ dZdZdZdZdS) BaseStreamc2|jrtddS)NzI/O operation on closed file)closed ValueErrorselfs 3/opt/alt/python311/lib64/python3.11/_compression.py_check_not_closedzBaseStream._check_not_closed s% ; =;<< < = =cV|stjddS)NzFile not open for reading)readableioUnsupportedOperationrs r _check_can_readzBaseStream._check_can_read1}} G)*EFF F G Gr cV|stjddS)NzFile not open for writing)writablerrrs r _check_can_writezBaseStream._check_can_writerr c|stjd|stjddS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)rrrseekablers r _check_can_seekzBaseStream._check_can_seeksl}} G)+FGG G}} F)+EFF F F Fr N)__name__ __module__ __qualname__r rrrr r rr s^)===GGGGGGFFFFFr rcheZdZ dZd dZfdZdZdZddZd Z d Z e j fd Z d ZxZS)DecompressReadercdS)NTrrs r rzDecompressReader.readable$str rc ||_d|_d|_d|_||_||_|jdi|j|_||_dS)NFrr)_fp_eof_pos_size_decomp_factory _decomp_args _decompressor_trailing_error)r fpdecomp_factorytrailing_error decomp_argss r __init__zDecompressReader.__init__'s`   .'1T1FFD4EFF .r cRd|_tSN)r(superclose)r __class__s r r2zDecompressReader.close;s!ww}}r c4|jSr0)r"rrs r rzDecompressReader.seekable?sx  """r c4t|5}|d5}|t|}||dt|<dddn #1swxYwYdddn #1swxYwYt|S)NB) memoryviewcastreadlen)r bview byte_viewdatas r readintozDecompressReader.readintoBs ]] )dDIIcNN )i99S^^,,D$(Ijs4yyj ! ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )4yys4B7A) B)A- -B0A- 1BBBr!cv|dkr|S|r|jrdSd} |jjrr|jjp|jt}|sn|jdi|j |_ |j ||}nj#|j $rYnbwxYw|jj r1|jt}|stdnd}|j ||}|rn|sd|_|j|_dS|xjt!|z c_|S)Nrr TzACompressed file ended before the end-of-stream marker was reachedr)readallr#r(eof unused_datar"r9 BUFFER_SIZEr&r' decompressr) needs_inputEOFErrorr$r%r:)r sizer>rawblocks r r9zDecompressReader.readHs !88<<>> ! ty 3 !% E .:7 HMM+66%9T%9&)&)'&)&)"-884HHDD+E%1##x}}[99H#K&(JKKKK #H)44XtDD 1 2 DIDJ3 SYY  s;B B$#B$cg}|tjx}r6|||tjx}6d|S)Nr )r9sysmaxsizeappendjoin)r chunksr>s r rAzDecompressReader.readallqsgii ,,,d MM$   ii ,,,d xxr c|jdd|_d|_|jdi|j|_dS)NrFr)r"seekr#r$r&r'r(rs r _rewindzDecompressReader._rewind|sH  a  1T1FFD4EFFr cf|tjkrn|tjkr |j|z}n|tjkrU|jdkr?|tjr |tj |j|z}n"td |||jkr| n ||jz}|dkrH|ttj|}|sn|t|z}|dkH|jS)NrzInvalid value for whence: {}) rSEEK_SETSEEK_CURr$SEEK_ENDr%r9DEFAULT_BUFFER_SIZErformatrRminr:)r offsetwhencer>s r rQzDecompressReader.seeks& R[  r{ " "Y'FF r{ " "zA~~ii 677ii 677Z&(FF;BB6JJKK K DI   LLNNNN di Fqjj99S!7@@AAD  c$ii F qjj yr c |jSr0)r$rs r tellzDecompressReader.tells /yr )r)r!)rrrrr.r2rr?r9rArRrrTrQr] __classcell__)r3s@r rr!s?....(### ''''R   GGG #%+<r r)rrKrWrDBufferedIOBaser RawIOBaserrr r ras= $ FFFFF"FFF0AAAAAr|AAAAAr