+
    i.  c                   s    . R
Ot Rt^ RIHt ^ RIHt ^ RIt^ RIt^ RI	H
t
Ht ^t^t ! R R ]P                  4      tRR ltRR ltR	 tR# )BZ2Filez%Nadeem Vawda <nadeem.vawda@gmail.com>)open)_streamsN)BZ2CompressorBZ2Decompressorc                   s   a  ] tR t^t o RR^	/R lltR t]R 4       t]R 4       t]R 4       t	R t
R tR	 tR
 tRR ltRR ltRR ltR tRR ltRR ltR tR t]P.                  3R ltR tRtV tR# )r    compresslevelc               s8   R V n         RV n        R V n        ^Tu;8:  d   ^	8:  g   M \        R4      hVR9   d
   Rp\        pMoVR9   d   Rp\
        p\        V4      V n        MOVR9   d   Rp\
        p\        V4      V n        M/VR9   d   Rp\
        p\        V4      V n        M\        RV: 24      h\        V\        \        \        P                  34      '       d   \        W4      V n         RV n        W@n        M<\        VR	4      '       g   \        VR
4      '       d   Wn         W@n        M\        R4      hV P                  \        8X  dI   \         P"                  ! V P                   \$        \&        R7      p\(        P*                  ! V4      V n        R # ^ V n        R # )NFz%compresslevel must be between 1 and 9rbwbxbabInvalid mode: Treadwritez6filename must be a str, bytes, file or PathLike object)Ztrailing_error) rr   )Zwr   )Zxr   )Zar	   )_fp_closefp_mode
ValueError
_MODE_READ_MODE_WRITEr   _compressor
isinstanceZstrbytesosZPathLike_builtin_openhasattr	TypeErrorr   ZDecompressReaderr   OSErrorioZBufferedReader_buffer_pos)selffilenamemoder   Z	mode_codeZraws   &&&$  /usr/lib64/python3.14/bz2.py__init__ZBZ2File.__init__%   sN   $ 
]'a'DEE?"D"I[ D#I,];D[ D#I,];D[ D#I,];D49::heR[[ 9::$X4DH DM"JXv&&'(G*D*DH"JTUU::#++DHH9C,,S1DLDI    c                s   V P                   '       d   R #  V P                  \        8X  d   V P                  P	                  4        MOV P                  \
        8X  d;   V P                  P                  V P                  P                  4       4       R V n         V P                  '       d   V P                  P	                  4        R V n        RV n
        R V n        R #   R T n        RT n
        R T n        i ; i   T P                  '       d   T P                  P	                  4        R T n        RT n
        R T n        i   R T n        RT n
        R T n        i ; i; i)NF)closedr   r   r   closer   r   r   r   flushr   r       &r#   r'   ZBZ2File.closea   s     ;;;	$zzZ'""${*t//5578#' $===HHNN$ %#   %#$===HHNN$ %#   %#s0   A?C3 ,C C03E5,D7!E7EEc                s    V P                   R J # N)r   r)   r*   r#   r&   ZBZ2File.closedx   s     xx4r%   c                sN    V P                  4        V P                  P                  # r+   )_check_not_closedr   namer)   r*   r#   r-   ZBZ2File.name}   s     xx}}r%   c                s4    V P                   \        8X  d   R # R# )r   r   )r   r   r)   r*   r#   r"   ZBZ2File.mode   s    zz[0t:d:r%   c                sV    V P                  4        V P                  P                  4       # r+   )r,   r   filenor)   r*   r#   r.   ZBZ2File.fileno   s     xx  r%   c                sf    V P                  4       ;'       d    V P                  P                  4       # r+   )readabler   seekabler)   r*   r#   r0   ZBZ2File.seekable   s#    }}::4<<#8#8#::r%   c                H    V P                  4        V P                  \        8H  # r+   )r,   r   r   r)   r*   r#   r/   ZBZ2File.readable   s     zzZ''r%   c                r1   r+   )r,   r   r   r)   r*   r#   writableZBZ2File.writable   s     zz[((r%   c                X    V P                  4        V P                  P                  V4      # r+   )_check_can_readr   peek)r    Zn   &&r#   r5   ZBZ2File.peek   s'     	 ||  ##r%   c                r3   r+   )r4   r   r   r    Zsizer6   r#   r   ZBZ2File.read   s%     	||  &&r%   c                s    V P                  4        V^ 8  d   \        P                  pV P                  P	                  V4      # i    )r4   r   ZDEFAULT_BUFFER_SIZEr   read1r7   r6   r#   r9   ZBZ2File.read1   s7     	!8))D||!!$''r%   c                r3   r+   )r4   r   readinto)r    br6   r#   r:   ZBZ2File.readinto   s%    
 	||$$Q''r%   c                    \        V\        4      '       g.   \        VR 4      '       g   \        R4      hVP	                  4       pV P                  4        V P                  P                  V4      # 	__index__zInteger argument expected)r   intr   r   r>   r4   r   readliner7   r6   r#   r@   ZBZ2File.readline   sW     $$$4-- ;<<>>#D||$$T**r%   c                r<   r=   )r   r?   r   r   r>   r4   r   	readlinesr7   r6   r#   rA   ZBZ2File.readlines   sW     $$$4-- ;<<>>#D||%%d++r%   c                sB   V P                  4        \        V\        \        34      '       d   \	        V4      pM\        V4      pVP                  pV P                  P                  V4      pV P                  P                  V4       V ;P                  V,          un        V# r+   )Z_check_can_writer   r   Z	bytearrayZlenZ
memoryviewZnbytesr   compressr   r   r   )r    dataZlengthZ
compresseds   &&  r#   r   ZBZ2File.write   sy     	dUI.//YF d#D[[F%%..t4
z"		V	r%   c                s@    \         P                  P                  W4      # r+   )r   
BaseStream
writelines)r    Zseqr6   r#   rE   ZBZ2File.writelines   s     ""--d88r%   c                sX    V P                  4        V P                  P                  W4      # r+   )Z_check_can_seekr   seek)r    ZoffsetZwhences   &&&r#   rF   ZBZ2File.seek   s%     	||  00r%   c                s    V P                  4        V P                  \        8X  d   V P                  P	                  4       # V P
                  # r+   )r,   r   r   r   tellr   r)   r*   r#   rG   ZBZ2File.tell  s7     ::#<<$$&&yyr%   )r   r   r   r   r   r   N)r   r8   )i)Z__name__Z
__module__Z__qualname__Z__firstlineno__r$   r'   Zpropertyr&   r-   r"   r.   r0   r/   r2   r5   r   r9   r:   r@   rA   r   rE   r   ZSEEK_SETrF   rG   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r#   r    r       s     :A :x$.       ; ;!
;(
)

$'
((+,*9 #%++ 1$ r%   c                 sB   R V9   d   RV9   d   \        RV: 24      hM-Ve   \        R4      hVe   \        R4      hVe   \        R4      hVP                  R R4      p\        WVR7      pR V9   d.   \        P                  ! V4      p\        P
                  ! WsWE4      # V# )Ztr;   r
   z0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder   )r   )r   Zreplacer    r   Ztext_encodingZTextIOWrapper)r!   r"   r   ZencodingZerrorsZnewlineZbz_modeZbinary_files   &&&&&&  r#   r   r     s    * d{$;49::  OPPMNNNOOll3#G(=IK
d{##H-vGGr%   c                 sd    \        V4      pVP                  V 4      VP                  4       ,           # r+   )r   rB   r(   )rC   r   Zcomps   && r#   rB   rB   A  s(     'D==--r%   c                 s   . pV '       dY   \        4       p VP                  V 4      pTP                  T4       TP                  '       g   \        R 4      hTP                  p K`  RP                  V4      #   \         d    T'       d    K'  h i ; i)zACompressed data ended before the end-of-stream marker was reachedr%   )r   
decompressr   ZappendZeofr   Zunused_dataZjoin)rC   ZresultsZdecompZress   &   r#   rH   rH   L  s    
 G
 "	##D)C 	szzz @ A A!!88G  			s   A4 4B
B)r    r   r   r   rB   rH   )r   	   NNN)rI   )Z__all__Z
__author__Zbuiltinsr   r   Zcompression._commonr   r   r   Z_bz2r   r   r   r   rD   r    rB   rH   ) r%   r#   <module>rJ      sS   - 5
 * ( 	 	 / 
zh!! zz'T.r%   