U if1@sddddddgZdZddlmZdd lZdd lZdd lZdd lZdd l m Z dd l m Z m Z dZd Zd ZeZGdddejZdddZdddZddZd S)BZ2File BZ2CompressorBZ2Decompressoropencompress decompressz%Nadeem Vawda )rN)RLock)rrc@seZdZdedfddZddZeddZd d Zd d Z d dZ ddZ d(ddZ d)ddZ d*ddZddZd+ddZd,ddZdd Zd!d"Zejfd#d$Zd%d&Zd'S)-rr cCsTt|_d|_d|_t|_|tk r2tjdt ddd|krFdksPnt d|dkrbd }t }nb|d kr~d }t }t ||_nF|d krd }t }t ||_n*|dkrd}t }t ||_nt d|ft|tttjfrt|||_d|_||_n.t|dst|dr||_||_ntd|jt krJtj|jttd}t||_nd|_dS)NFzGUse of 'buffering' argument is deprecated and ignored since Python 3.0.) stacklevelr r z%compresslevel must be between 1 and 9)r rbr)wwbr)xxbr)aabrInvalid mode: %rTreadwritez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorr)r_lock_fp_closefp _MODE_CLOSED_mode _sentinelwarningswarnDeprecationWarning ValueError _MODE_READ _MODE_WRITEr _compressor isinstancestrbytesosPathLike _builtin_openhasattr TypeError _compressionZDecompressReaderrOSErrorioBufferedReader_buffer_pos)selffilenamemode buffering compresslevelZ mode_coderawr;(/opt/alt/python38/lib64/python3.8/bz2.py__init__)sT     zBZ2File.__init__cCs|j|jtkr W5QRdSz<|jtkr8|jn"|jtkrZ|j |j d|_ W5z|jrp|jW5d|_d|_t|_d|_XXW5QRXdS)NF) rrrrrr3closer$r%rr&flushr5r;r;r<r>ps      z BZ2File.closecCs |jtkSN)rrr@r;r;r<closedszBZ2File.closedcCs||jSrA)_check_not_closedrfilenor@r;r;r<rDszBZ2File.filenocCs|o|jSrA)readabler3seekabler@r;r;r<rFszBZ2File.seekablecCs||jtkSrA)rCrr$r@r;r;r<rEszBZ2File.readablecCs||jtkSrA)rCrr%r@r;r;r<writableszBZ2File.writablerc Cs2|j"||j|W5QRSQRXdSrA)r_check_can_readr3peek)r5nr;r;r<rIsz BZ2File.peekc Cs2|j"||j|W5QRSQRXdSrA)rrHr3rr5sizer;r;r<rsz BZ2File.readc Cs@|j0||dkrtj}|j|W5QRSQRXdS)Nr)rrHr1DEFAULT_BUFFER_SIZEr3read1rLr;r;r<rOs z BZ2File.read1c Cs2|j"||j|W5QRSQRXdSrA)rrHr3readinto)r5br;r;r<rPszBZ2File.readintoc CsVt|ts$t|dstd|}|j"||j|W5QRSQRXdSN __index__zInteger argument expected) r'intr-r.rSrrHr3readlinerLr;r;r<rUs  zBZ2File.readlinec CsVt|ts$t|dstd|}|j"||j|W5QRSQRXdSrR) r'rTr-r.rSrrHr3 readlinesrLr;r;r<rVs  zBZ2File.readlinesc CsX|jH||j|}|j||jt|7_t|W5QRSQRXdSrA)rZ_check_can_writer&rrrr4len)r5dataZ compressedr;r;r<rs   z BZ2File.writec Cs,|jtj||W5QRSQRXdSrA)rr/ BaseStream writelines)r5seqr;r;r<rZszBZ2File.writelinesc Cs4|j$||j||W5QRSQRXdSrA)rZ_check_can_seekr3seek)r5offsetwhencer;r;r<r\sz BZ2File.seekc CsL|j<||jtkr0|jW5QRS|jW5QRSQRXdSrA)rrCrr$r3tellr4r@r;r;r<r_s  z BZ2File.tellN)r)rK)rK)rK)rK)__name__ __module__ __qualname__rr=r>propertyrBrDrFrErGrIrrOrPrUrVrrZr1SEEK_SETr\r_r;r;r;r<rs$ G     rr cCsd|kr d|krPtd|fn0|dk r0td|dk r@td|dk rPtd|dd}t|||d}d|krt||||S|SdS) NtrQrz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder)r9)r#replacerr1 TextIOWrapper)r6r7r9encodingerrorsnewlineZbz_modeZ binary_filer;r;r<r!s cCst|}|||SrA)rrr?)rXr9compr;r;r<rJscCshg}|r^t}z||}Wn tk r<|r6Yq^nYnX|||jsVtd|j}qd|S)NzACompressed data ended before the end-of-stream marker was reached)rrr0appendeofr#Z unused_datajoin)rXZresultsZdecompresr;r;r<rUs )rr NNN)r )__all__ __author__builtinsrr,r1r*r r/Z threadingrZ_bz2rrrr$r%objectrrYrrrr;r;r;r<s4   )