JezK
Edit File: crt.cpython-311.pyc
� ��f�� � � � d dl Z d dlZd dlmZ d dlZd dlZd dlZd dl Zd dl mZmZm Z mZ d dlmZmZmZmZmZ d dlmZmZmZ d dlmZ d dlmZ d dlmZ d d lmZ d d lm Z d dl!m"Z" d dl#m$Z$m%Z% d d l&m'Z' d dl(m)Z)m*Z*m+Z+m,Z, e j- e.� � Z/da0d� Z1dddde z ddfd�Z2d,d�Z3 G d� d� � Z4 G d� de%� � Z5 G d� de$� � Z6 G d� d� � Z7 G d� de7� � Z8 G d� de� � Z9 G d � d!� � Z: G d"� d#� � Z; G d$� d%� � Z< G d&� d'� � Z= G d(� d)� � Z> G d*� d+� � Z?dS )-� N)�BytesIO)�AwsCredentials�AwsCredentialsProvider�AwsSigningAlgorithm�AwsSigningConfig)�ClientBootstrap�ClientTlsContext�DefaultHostResolver�EventLoopGroup�TlsContextOptions)�S3Client�S3RequestTlsMode� S3RequestType)�UNSIGNED)�urlsplit)�Config)�NoCredentialsError)�MB)�TransferNotDoneError)�BaseTransferFuture�BaseTransferMeta)�TransferManager)�CallArgs�OSUtils� get_callbacks�is_s3express_bucketc � � t �Ht j � | � � } |� � � n# t $ r Y d S w xY w|a t S �N)�CRT_S3_PROCESS_LOCK�awscrt�s3�CrossProcessLock�acquire�RuntimeError)�name�crt_locks �A/opt/alt/python311/lib/python3.11/site-packages/s3transfer/crt.py�acquire_crt_s3_process_lockr( 8 sk � � �"��9�-�-�d�3�3�� ���������� � � � �4�4� ���� '���s �= � A� A� Tc � � t |� � }t |� � }t ||� � } d} |rt j nt j }|�Qt � � }|r|� |�� � nd|_ t |� � } | � � � } t |�� � }t | | |||| |d�� � S )a� :type region: str :param region: The region used for signing :type crt_credentials_provider: Optional[awscrt.auth.AwsCredentialsProvider] :param crt_credentials_provider: CRT AWS credentials provider to use to sign requests. If not set, requests will not be signed. :type num_threads: Optional[int] :param num_threads: Number of worker threads generated. Default is the number of processors in the machine. :type target_throughput: Optional[int] :param target_throughput: Throughput target in bytes per second. By default, CRT will automatically attempt to choose a target throughput that matches the system's maximum network throughput. Currently, if CRT is unable to determine the maximum network throughput, a fallback target throughput of ``1_250_000_000`` bytes per second (which translates to 10 gigabits per second, or 1.16 gibibytes per second) is used. To set a specific target throughput, set a value for this parameter. :type part_size: Optional[int] :param part_size: Size, in Bytes, of parts that files will be downloaded or uploaded in. :type use_ssl: boolean :param use_ssl: Whether or not to use SSL. By default, SSL is used. Note that not all services support non-ssl connections. :type verify: Optional[boolean/string] :param verify: Whether or not to verify SSL certificates. By default SSL certificates are verified. You can provide the following values: * False - do not validate SSL certificates. SSL will still be used (unless use_ssl is False), but SSL certificates will not be verified. * path/to/cert/bundle.pem - A filename of the CA cert bundle to use. Specify this argument if you want to use a custom CA cert bundle instead of the default one on your system. N)�ca_filepathF)� provided_throughput_target_bytesT)� bootstrap�region�credential_provider� part_size�tls_mode�tls_connection_options�throughput_target_gbps�enable_s3express) r r r r �ENABLED�DISABLEDr �&override_default_trust_store_from_path�verify_peerr �new_connection_options�_get_crt_throughput_target_gbpsr )r. �crt_credentials_provider�num_threads�target_throughputr0 �use_ssl�verify�event_loop_group� host_resolverr- r2 r1 �tls_ctx_options�client_tls_option�target_gbpss r'