Your IP : 3.135.247.24
a
R�f�0 � @ s� g d �Z dZddlmZ ddlZddlZddlZddlm Z ddl
mZmZ dZ
dZdZG d d
� d
ej�Zdd
d�Zddd�Zdd� ZdS ))�BZ2File�
BZ2Compressor�BZ2Decompressor�open�compress�
decompressz%Nadeem Vawda <nadeem.vawda@gmail.com>� )r N)�RLock)r r � � c @ s� e Zd Zd)dd�dd�Zdd� Zedd � �Zd
d� Zdd
� Zdd� Z dd� Z
d*dd�Zd+dd�Zd,dd�Z
dd� Zd-dd�Zd.dd�Zd d!� Zd"d#� Zejfd$d%�Zd&d'� Zd(S )/r �r� ��
compresslevelc C s8 t � | _d | _d| _t| _d| kr.dks8n td��|dv rJd}t}nb|dv rfd}t}t |�| _
nF|d v r�d
}t}t |�| _
n*|dv r�d}t}t |�| _
ntd
|f ��t|tt
tjf�r�t||�| _d| _|| _n*t|d�s�t|d�r�|| _|| _ntd��| jtk�r.tj| jttd�}t�|�| _nd| _d S )NFr 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�
ValueError�
_MODE_READ�_MODE_WRITEr �_compressor�
isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr� TypeError�_compressionZDecompressReaderr �OSError�io�BufferedReader�_buffer�_pos)�self�filename�moder Z mode_code�raw� r5 �(/opt/alt/python39/lib64/python3.9/bz2.py�__init__&