Your IP : 52.15.71.146
U
e5d1 � @ s� d dddddgZ dZddlmZ dd lZdd lZdd lZdd lZdd
l m
Z
ddlmZm
Z
dZdZd
Ze� ZG dd � d ej�Zddd�Zddd�Zdd� Zd S )�BZ2File�
BZ2Compressor�BZ2Decompressor�open�compress�
decompressz%Nadeem Vawda <nadeem.vawda@gmail.com>� )r N)�RLock)r r � � c @ s� e Zd Zdedfdd�Zdd� Zedd� �Zd d
� Zdd� Z d
d� Z
dd� Zd(dd�Zd)dd�Z
d*dd�Zdd� Zd+dd�Zd,dd�Zdd � Zd!d"� Zejfd#d$�Zd%d&� Zd'S )-r �r� c C sT t � | _d | _d| _t| _|tk r2tjdt dd� d| krFdksPn t
d��|dkrbd }t}nb|d
kr~d}t}t
|�| _nF|dkr�d
}t}t
|�| _n*|dkr�d}t}t
|�| _nt
d|f ��t|tttjf�r�t||�| _d| _|| _n.t|d��st|d��r|| _|| _ntd��| jtk�rJtj| jttd�}t�|�| _nd| _d S )NFzGUse of 'buffering' argument is deprecated and ignored since Python 3.0.� )�
stacklevelr r z%compresslevel must be between 1 and 9)� r �rbr )�w�wbr )�x�xbr )�a�abr �Invalid mode: %rT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorr )r �_lock�_fp�_closefp�_MODE_CLOSED�_mode� _sentinel�warnings�warn�DeprecationWarning�
ValueError�
_MODE_READ�_MODE_WRITEr �_compressor�
isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr� TypeError�_compressionZDecompressReaderr �OSError�io�BufferedReader�_buffer�_pos)�self�filename�mode� buffering�
compresslevelZ mode_code�raw� r; �/usr/lib64/python3.8/bz2.py�__init__) sT � �zBZ2File.__init__c C s� | j �� | jtkr W 5 Q R � d S z<| jtkr8| j�� n"| jtkrZ| j� | j
�� � d | _
W 5 z| jrp| j�� W 5 d | _d| _t| _d | _X X W 5 Q R X d S )NF)r r r r r r3 �closer$ r% r r&