HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/awscli/customizations/s3/__pycache__/utils.cpython-36.pyc
3

�U_Dm�	@s�ddlZddlZddlmZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZmZddlmZddlmZddlmZeje�Zd]Zeddde�d�Zd_Zdd`dadbddcddded�Zejd�Zejd�Zdd�Zdd�Z Gdd�dej!�Z"Gd d!�d!e#�Z$Gd"d#�d#ej%�Z&d$d%�Z'd&d'�Z(d(d)�Z)dfd*d+�Z*dgd-d.�Z+Gd/d0�d0e,�Z-d1d2�Z.ej/j0fd3d4�Z1d5d6�Z2Gd7d8�d8e#�Z3d9d:�Z4Gd;d<�d<e,�Z5Gd=d>�d>e	d>d?d@dAdBg��Z6e6Z7GdCdD�dDe,�Z8GdEdF�dFe�Z9GdGdH�dHe�Z:GdIdJ�dJe:�Z;GdKdL�dLe;�Z<GdMdN�dNe<�Z=GdOdP�dPe;�Z>GdQdR�dRe�Z?GdSdT�dTe?�Z@GdUdV�dVe?�ZAGdWdX�dXe:�ZBGdYdZ�dZe�ZCGd[d\�d\e,�ZDdS)h�N)�datetime)�
namedtuple�deque)�parse)�tzlocal�tzutc)�BaseSubscriber)�bytes_print)�queue�KiB�MiB�GiB�TiB�PiB�EiBi��)Ztzinfo�i���)ZkbZmbZgb�tbZkibZmibZgibZtibzT^(?P<bucket>arn:(aws).*:s3:[a-z\-0-9]+:[0-9]{12}:accesspoint[:/][^/]+)/?(?P<key>.*)$z�^(?P<bucket>arn:(aws).*:s3-outposts:[a-z\-0-9]+:[0-9]{12}:outpost[/:][a-zA-Z0-9\-]{1,63}[/:]accesspoint[/:][a-zA-Z0-9\-]{1,63})[/:]?(?P<key>.*)$cCsvd}t|�}|dkrdS||kr(d|SxHtt�D]<\}}||d}t|||�|kr2d||||fSq2WdS)a�Convert a size in bytes into a human readable format.

    For example::

        >>> human_readable_size(1)
        '1 Byte'
        >>> human_readable_size(10)
        '10 Bytes'
        >>> human_readable_size(1024)
        '1.0 KiB'
        >>> human_readable_size(1024 * 1024)
        '1.0 MiB'

    :param value: The size in bytes.
    :return: The size in a human readable format based on base-2 units.

    irz1 Bytez%d Bytesrz%.1f %sN)�float�	enumerate�HUMANIZE_SUFFIXES�round)�value�baseZ	bytes_int�i�suffixZunit�r�/usr/lib/python3.6/utils.py�human_readable_size8sr!cCs�|j�}|dd�dkr*|dd�j�}n|dd�j�}t|�dkoL|tk}|s~yt|�Stk
rztd|��Yq�Xn"t|}t|dt|���|SdS)	aConverts a human readable size to bytes.

    :param value: A string such as "10MB".  If a suffix is not included,
        then the value is assumed to be an integer representing the size
        in bytes.
    :returns: The converted value in bytes as an integer

    rNZibrzInvalid size value: %s������r")�lower�len�SIZE_SUFFIX�int�
ValueError)rrZhas_size_identifierZ
multiplierrrr �human_readable_to_bytesXs	r)c@seZdZdZddd�ZdS)�AppendFiltera�
    This class is used as an action when parsing the parameters.
    Specifically it is used for actions corresponding to exclude
    and include filters.  What it does is that it appends a list
    consisting of the name of the parameter and its value onto
    a list containing these [parameter, value] lists.  In this
    case, the name of the parameter will either be --include or
    --exclude and the value will be the rule to apply.  This will
    format all of the rules inputted into the command line
    in a way compatible with the Filter class.  Note that rules that
    appear later in the command line take preferance over rulers that
    appear earlier.
    NcCsDt||j�}|r$|j||dg�n||dgg}t||j|�dS)Nr)�getattr�dest�append�setattr)�self�parser�	namespace�valuesZ
option_stringZfilter_listrrr �__call__�s
zAppendFilter.__call__)N)�__name__�
__module__�__qualname__�__doc__r3rrrr r*ss
r*c@seZdZdS)�CreateDirectoryErrorN)r4r5r6rrrr r8�sr8c@s2eZdZdZd
dd�Zdd�Zdd	�Zd
d�ZdS)�StablePriorityQueuea�Priority queue that maintains FIFO order for same priority items.

    This class was written to handle the tasks created in
    awscli.customizations.s3.tasks, but it's possible to use this
    class outside of that context.  In order for this to be the case,
    the following conditions should be met:

        * Objects that are queued should have a PRIORITY attribute.
          This should be an integer value not to exceed the max_priority
          value passed into the ``__init__``.  Objects with lower
          priority numbers are retrieved before objects with higher
          priority numbers.
        * A relatively small max_priority should be chosen.  ``get()``
          calls are O(max_priority).

    Any object that does not have a ``PRIORITY`` attribute or whose
    priority exceeds ``max_priority`` will be queued at the highest
    (least important) priority available.

    r�cCs2tjj||d�dd�t|d�D�|_||_dS)N)�maxsizecSsg|]}tg��qSr)r)�.0rrrr �
<listcomp>�sz0StablePriorityQueue.__init__.<locals>.<listcomp>r)r
�Queue�__init__�range�
priorities�default_priority)r/r;Zmax_priorityrrr r?�szStablePriorityQueue.__init__cCs$d}x|jD]}|t|�7}qW|S)Nr)rAr%)r/�size�bucketrrr �_qsize�szStablePriorityQueue._qsizecCs*tt|d|j�|j�}|j|j|�dS)NZPRIORITY)�minr+rBrAr-)r/�itemZpriorityrrr �_put�szStablePriorityQueue._putcCs x|jD]}|sq|j�SWdS)N)rA�popleft)r/rDrrr �_get�szStablePriorityQueue._getN)rr:)r4r5r6r7r?rErHrJrrrr r9�s

r9cCsxtj|�}|r"|jd�|jd�fStj|�}|rD|jd�|jd�fS|jdd�}|d}d}t|�dkrp|d}||fS)z�
    This is a helper function that given an s3 path such that the path is of
    the form: bucket/key
    It will return the bucket and the key represented by the s3 path
    rD�key�/rr�)�#_S3_ACCESSPOINT_TO_BUCKET_KEY_REGEX�match�group�_S3_OUTPOST_TO_BUCKET_KEY_REGEX�splitr%)�s3_pathrOZ
s3_componentsrDZs3_keyrrr �find_bucket_key�s

rTcCs|jd�r|dd�}t|�S)z�Split s3 path into bucket and key prefix.

    This will also handle the s3:// prefix.

    :return: Tuple of ('bucketname', 'keyname')

    zs3://rN)�
startswithrT)rSrrr �split_s3_bucket_key�s
rVcCs�ytj|�}Wn2tk
r@}ztd||f��WYdd}~XnXytj|jt��}Wnttt	fk
rtd}YnX|j
|fS)z�
    This is a helper function that given a local path return the size of
    the file in bytes and time of last modification.
    z(Could not retrieve file stat of "%s": %sN)�os�stat�IOErrorr(rZ
fromtimestamp�st_mtimer�OSError�
OverflowError�st_size)�pathZstats�eZupdate_timerrr �
get_file_stat�s
r`c
Cs�|d}|d}|d}|d}|dkr0|d}dtjd�}|drZ|t|d�d�}n|j||�d}|j||d�}|d
r�|d}	|	|j||||�7}	n|d}	|	|fS)z�
    This is a helper function that determines the destination path and compare
    key given parameters received from the ``FileFormat`` class.
    �srcr,�typeNr^rL)Zs3ZlocalZdir_oprZuse_src_name���)rW�sepr%rR�replace)
�filesZsrc_pathrar,Zsrc_typeZ	dest_typeZ	sep_tableZrel_pathZcompare_keyZ	dest_pathrrr �find_dest_path_comp_key�s"rgTcCs2d}|r|d|d}||}t|ddd�}|S)zN
    This creates a ``PrintTask`` for whenever a warning is to be thrown.
    z	warning: zSkipping file z. FT)�message�error�warning)�
WarningResult)r^Z
error_messageZ	skip_fileZprint_string�warning_messagerrr �create_warningsrmc@s"eZdZdZddd�Zdd�ZdS)�StdoutBytesWriterzd
    This class acts as a file-like object that performs the bytes_print
    function on write.
    NcCs
||_dS)N)�_stdout)r/�stdoutrrr r?"szStdoutBytesWriter.__init__cCst||j�dS)zR
        Writes data to stdout as bytes.

        :param b: data to write
        N)r	ro)r/�brrr �write%szStdoutBytesWriter.write)N)r4r5r6r7r?rrrrrr rns
rncCs8ytj|�dStk
r2tjd|dd�YnXdS)zpGiven a filename, guess it's content type.

    If the type cannot be guessed, a value of None is returned.
    rz?Unable to guess content type for %s due to UnicodeDecodeError: T)�exc_infoN)�	mimetypesZ
guess_type�UnicodeDecodeError�LOGGER�debug)�filenamerrr �guess_content_type.s	rycCsNy,tjj|�\}}tjj||�}tjj||�Stk
rHtjj|�SXdS)z�Cross platform relative path of a filename.

    If no relative path can be calculated (i.e different
    drives on Windows), then instead of raising a ValueError,
    the absolute path is returned.

    N)rWr^rR�relpath�joinr(�abspath)rx�start�dirname�basenameZrelative_dirrrr �
relative_pathDsr�cCsTytj|||f�Wn:tk
rN}z|jtjkr6|�td��WYdd}~XnXdS)aB
    Set the utime of a file, and if it fails, raise a more explicit error.

    :param filename: the file to modify
    :param desired_time: the epoch timestamp to set for atime and mtime.
    :raises: SetFileUtimeError: if you do not have permission (errno 1)
    :raises: OSError: for all errors other than errno 1
    zrThe file was downloaded, but attempting to modify the utime of the file failed. Is the file owned by another user?N)rW�utimer[�errnoZEPERM�SetFileUtimeError)rxZdesired_timer_rrr �set_file_utimeTs	r�c@seZdZdS)r�N)r4r5r6rrrr r�hsr�cCst|�jt��S)N)rZ
astimezoner)Zdate_stringrrr �_date_parserlsr�c@s&eZdZdZefdd�Zddd�ZdS)�BucketListerzList keys in a bucket.cCs||_||_dS)N)�_clientr�)r/�clientZdate_parserrrr r?rszBucketLister.__init__Nccs�|d|id�}|dk	r||d<|dk	r0|j|�|jjd�}|jf|�}xR|D]J}|jdg�}	x8|	D]0}
|d|
d}|j|
d�|
d<||
fVqdWqNWdS)	NZPageSize)�BucketZPaginationConfigZPrefixZlist_objects_v2ZContentsrL�KeyZLastModified)�updater�Z
get_paginatorZpaginate�getr�)r/rD�prefixZ	page_size�
extra_args�kwargsZ	paginatorZpagesZpage�contentsZcontent�source_pathrrr �list_objectsvs


zBucketLister.list_objects)NNN)r4r5r6r7r�r?r�rrrr r�psr�cseZdZd�fdd�	Z�ZS)�	PrintTaskFNcstt|�j|||||�S)aN
        :param message: An arbitrary string associated with the entry.   This
            can be used to communicate the result of the task.
        :param error: Boolean indicating a failure.
        :param total_parts: The total number of parts for multipart transfers.
        :param warning: Boolean indicating a warning
        )�superr��__new__)�clsrhri�total_partsrj)�	__class__rr r��szPrintTask.__new__)FNN)r4r5r6r��
__classcell__rr)r�r r��sr�rhrir�rjc@seZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zed(d)��Zd*S)+�RequestParamsMappera�A utility class that maps CLI params to request params

    Each method in the class maps to a particular operation and will set
    the request parameters depending on the operation and CLI parameters
    provided. For each of the class's methods the parameters are as follows:

    :type request_params: dict
    :param request_params: A dictionary to be filled out with the appropriate
        parameters for the specified client operation using the current CLI
        parameters

    :type cli_params: dict
    :param cli_params: A dictionary of the current CLI params that will be
        used to generate the request parameters for the specified operation

    For example, take the mapping of request parameters for PutObject::

        >>> cli_request_params = {'sse': 'AES256', 'storage_class': 'GLACIER'}
        >>> request_params = {}
        >>> RequestParamsMapper.map_put_object_params(
                request_params, cli_request_params)
        >>> print(request_params)
        {'StorageClass': 'GLACIER', 'ServerSideEncryption': 'AES256'}

    Note that existing parameters in ``request_params`` will be overriden if
    a parameter in ``cli_params`` maps to the existing parameter.
    cCs@|j||�|j||�|j||�|j||�|j||�dS)z*Map CLI params to PutObject request paramsN)�_set_general_object_params�_set_metadata_params�_set_sse_request_params�_set_sse_c_request_params�_set_request_payer_param)r��request_params�
cli_paramsrrr �map_put_object_params�s
z)RequestParamsMapper.map_put_object_paramscCs|j||�|j||�dS)z*Map CLI params to GetObject request paramsN)r�r�)r�r�r�rrr �map_get_object_params�sz)RequestParamsMapper.map_get_object_paramscCsV|j||�|j||�|j||�|j|�|j||�|j||�|j||�dS)z+Map CLI params to CopyObject request paramsN)r��_set_metadata_directive_paramr��!_auto_populate_metadata_directiver��)_set_sse_c_and_copy_source_request_paramsr�)r�r�r�rrr �map_copy_object_params�s
z*RequestParamsMapper.map_copy_object_paramscCs|j||�|j||�dS)z+Map CLI params to HeadObject request paramsN)r�r�)r�r�r�rrr �map_head_object_params�sz*RequestParamsMapper.map_head_object_paramscCs@|j||�|j||�|j||�|j||�|j||�dS)z6Map CLI params to CreateMultipartUpload request paramsN)r�r�r�r�r�)r�r�r�rrr �"map_create_multipart_upload_params�s
z6RequestParamsMapper.map_create_multipart_upload_paramscCs|j||�|j||�dS)z+Map CLI params to UploadPart request paramsN)r�r�)r�r�r�rrr �map_upload_part_params�sz*RequestParamsMapper.map_upload_part_paramscCs|j||�|j||�dS)z/Map CLI params to UploadPartCopy request paramsN)r�r�)r�r�r�rrr �map_upload_part_copy_params�sz/RequestParamsMapper.map_upload_part_copy_paramscCs|j||�dS)N)r�)r�r�r�rrr �map_delete_object_params�sz,RequestParamsMapper.map_delete_object_paramscCs|j||�dS)N)r�)r�r�r�rrr �map_list_objects_v2_params�sz.RequestParamsMapper.map_list_objects_v2_paramscCs|jd�r|d|d<dS)NZ
request_payer�RequestPayer)r�)r�r�r�rrr r��s
z,RequestParamsMapper._set_request_payer_paramc
CsTddddddddd	d
�	}x*|D]"}|j|�r||}||||<qW|j||�dS)NZACLZStorageClassZWebsiteRedirectLocation�ContentTypeZCacheControlZContentDispositionZContentEncodingZContentLanguageZExpires)	ZaclZ
storage_classZwebsite_redirectZcontent_typeZ
cache_controlZcontent_dispositionZcontent_encodingZcontent_languageZexpires)r��_set_grant_params)r�r�r�Zgeneral_param_translationZcli_param_nameZrequest_param_namerrr r��s

z.RequestParamsMapper._set_general_object_paramsc
Cs`|jd�r\xP|dD]D}y|jdd�\}}Wntk
rHtd��YnX|||j|�<qWdS)NZgrants�=rz1grants should be of the form permission=principal)r�rRr(�_permission_to_param)r�r�r�Zgrant�
permissionZgranteerrr r�s
z%RequestParamsMapper._set_grant_paramscCs<|dkrdS|dkrdS|dkr$dS|dkr0dStd	��dS)
N�readZ	GrantReadZfullZGrantFullControlZreadaclZGrantReadACPZwriteaclZ
GrantWriteACPz5permission must be one of: read|readacl|writeacl|full)r()r�r�rrr r�sz(RequestParamsMapper._permission_to_paramcCs|jd�r|d|d<dS)NZmetadata�Metadata)r�)r�r�r�rrr r�'s
z(RequestParamsMapper._set_metadata_paramscCs"|jd�r|jd�rd|d<dS)Nr��MetadataDirectiveZREPLACE)r�)r�r�rrr r�,s
z5RequestParamsMapper._auto_populate_metadata_directivecCs|jd�r|d|d<dS)NZmetadata_directiver�)r�)r�r�r�rrr r�2s
z1RequestParamsMapper._set_metadata_directive_paramcCs0|jd�r|d|d<|jd�r,|d|d<dS)NZsseZServerSideEncryptionZsse_kms_key_idZSSEKMSKeyId)r�)r�r�r�rrr r�8s

z+RequestParamsMapper._set_sse_request_paramscCs&|jd�r"|d|d<|d|d<dS)NZsse_cZSSECustomerAlgorithmZ	sse_c_keyZSSECustomerKey)r�)r�r�r�rrr r�?s
z-RequestParamsMapper._set_sse_c_request_paramscCs&|jd�r"|d|d<|d|d<dS)NZsse_c_copy_sourceZCopySourceSSECustomerAlgorithmZsse_c_copy_source_keyZCopySourceSSECustomerKey)r�)r�r�r�rrr �%_set_sse_c_copy_source_request_paramsEs


z9RequestParamsMapper._set_sse_c_copy_source_request_paramscCs|j||�|j||�dS)N)r�r�)r�r�r�rrr r�Msz=RequestParamsMapper._set_sse_c_and_copy_source_request_paramsN)r4r5r6r7�classmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr r��s*		
r�c@s eZdZdZdd�Zdd�ZdS)�ProvideSizeSubscriberzK
    A subscriber which provides the transfer size before it's queued.
    cCs
||_dS)N)rC)r/rCrrr r?XszProvideSizeSubscriber.__init__cKs|jj|j�dS)N)�metaZprovide_transfer_sizerC)r/�futurer�rrr �	on_queued[szProvideSizeSubscriber.on_queuedN)r4r5r6r7r?r�rrrr r�Tsr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�OnDoneFilteredSubscriberz�Subscriber that differentiates between successes and failures

    It is really a convenience class so developers do not have to have
    to constantly remember to have a general try/except around future.result()
    cKsXd}y|j�Wn&tk
r6}z
|}WYdd}~XnX|rJ|j||�n
|j|�dS)N)�result�	Exception�_on_failure�_on_success)r/r�r�Zfuture_exceptionr_rrr �on_donehsz OnDoneFilteredSubscriber.on_donecCsdS)Nr)r/r�rrr r�vsz$OnDoneFilteredSubscriber._on_successcCsdS)Nr)r/r�r_rrr r�ysz$OnDoneFilteredSubscriber._on_failureN)r4r5r6r7r�r�r�rrrr r�bsr�c@s eZdZdZdd�Zdd�ZdS)�DeleteSourceSubscriberz6A subscriber which deletes the source of the transfer.cCs@y|j|�Wn,tk
r:}z|j|�WYdd}~XnXdS)N)�_delete_sourcer�Z
set_exception)r/r�r_rrr r�sz"DeleteSourceSubscriber._on_successcCstd��dS)Nz_delete_source())�NotImplementedError)r/r�rrr r��sz%DeleteSourceSubscriber._delete_sourceN)r4r5r6r7r�r�rrrr r�}sr�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�DeleteSourceObjectSubscriberz%A subscriber which deletes an object.cCs
||_dS)N)r�)r/r�rrr r?�sz%DeleteSourceObjectSubscriber.__init__cCs|jS)N)rD)r/�	call_argsrrr �_get_bucket�sz(DeleteSourceObjectSubscriber._get_bucketcCs|jS)N)rK)r/r�rrr �_get_key�sz%DeleteSourceObjectSubscriber._get_keycCsJ|jj}|j|�|j|�d�}|jjd�r8|jd|d<|jjf|�dS)N)r�r�r�)r�r�r�r�r�r�r�Z
delete_object)r/r�r�Zdelete_object_kwargsrrr r��s
z+DeleteSourceObjectSubscriber._delete_sourceN)r4r5r6r7r?r�r�r�rrrr r��s
r�c@s eZdZdZdd�Zdd�ZdS)� DeleteCopySourceObjectSubscriberz+A subscriber which deletes the copy source.cCs
|jdS)Nr�)�copy_source)r/r�rrr r��sz,DeleteCopySourceObjectSubscriber._get_bucketcCs
|jdS)Nr�)r�)r/r�rrr r��sz)DeleteCopySourceObjectSubscriber._get_keyN)r4r5r6r7r�r�rrrr r��sr�c@seZdZdZdd�ZdS)�DeleteSourceFileSubscriberz"A subscriber which deletes a file.cCstj|jjj�dS)N)rW�remover�r��fileobj)r/r�rrr r��sz)DeleteSourceFileSubscriber._delete_sourceN)r4r5r6r7r�rrrr r��sr�c@s eZdZdZdd�Zdd�ZdS)� BaseProvideContentTypeSubscriberz@A subscriber that provides content type when creating s3 objectscKs(t|j|��}|dk	r$||jjjd<dS)Nr�)ry�
_get_filenamer�r�r�)r/r�r�Zguessed_typerrr r��sz*BaseProvideContentTypeSubscriber.on_queuedcCstd��dS)Nz_get_filename())r�)r/r�rrr r��sz.BaseProvideContentTypeSubscriber._get_filenameN)r4r5r6r7r�r�rrrr r��sr�c@seZdZdd�ZdS)�"ProvideUploadContentTypeSubscribercCs
|jjjS)N)r�r�r�)r/r�rrr r��sz0ProvideUploadContentTypeSubscriber._get_filenameN)r4r5r6r�rrrr r��sr�c@seZdZdd�ZdS)� ProvideCopyContentTypeSubscribercCs|jjjdS)Nr�)r�r�r�)r/r�rrr r��sz.ProvideCopyContentTypeSubscriber._get_filenameN)r4r5r6r�rrrr r��sr�c@s eZdZdZdd�Zdd�ZdS)�!ProvideLastModifiedTimeSubscriberz Sets utime for a downloaded filecCs||_||_dS)N)�_last_modified_time�
_result_queue)r/Zlast_modified_timeZresult_queuerrr r?�sz*ProvideLastModifiedTimeSubscriber.__init__cKsv|jjj}y&|jj�}tj|�}t|t|��Wn@t	k
rp}z$d||f}|j
jt||��WYdd}~XnXdS)NzNSuccessfully Downloaded %s but was unable to update the last modified time. %s)
r�r�r�r�Z	timetuple�timeZmktimer�r'r�r�Zputrm)r/r�r�rxZlast_update_tupleZ
mod_timestampr_rlrrr r��s



z-ProvideLastModifiedTimeSubscriber._on_successN)r4r5r6r7r?r�rrrr r��sr�c@seZdZdZdd�ZdS)�DirectoryCreatorSubscriberz4Creates a directory to download if it does not existcKsptjj|jjj�}ytjj|�s*tj|�Wn>tk
rj}z"|j	t	j
ksZtd||f��WYdd}~XnXdS)Nz!Could not create directory %s: %s)rWr^r~r�r�r��exists�makedirsr[r�ZEEXISTr8)r/r�r��dr_rrr r��sz$DirectoryCreatorSubscriber.on_queuedN)r4r5r6r7r�rrrr r��sr�c@s"eZdZdZdd�Zddd�ZdS)�NonSeekableStreama�Wrap a file like object as a non seekable stream.

    This class is used to wrap an existing file like object
    such that it only has a ``.read()`` method.

    There are some file like objects that aren't truly seekable
    but appear to be.  For example, on windows, sys.stdin has
    a ``seek()`` method, and calling ``seek(0)`` even appears
    to work.  However, subsequent ``.read()`` calls will just
    return an empty string.

    Consumers of these file like object have no way of knowing
    if these files are truly seekable or not, so this class
    can be used to force non-seekable behavior when you know
    for certain that a fileobj is non seekable.

    cCs
||_dS)N)�_fileobj)r/r�rrr r?�szNonSeekableStream.__init__NcCs"|dkr|jj�S|jj|�SdS)N)r�r�)r/Zamtrrr r��s
zNonSeekableStream.read)N)r4r5r6r7r?r�rrrr r��sr�)rrr
rrrllii@lii@l)N)T)E�argparseZloggingrrtr�rW�rer��collectionsrrZdateutil.parserrZdateutil.tzrrZs3transfer.subscribersrZ
awscli.compatr	r
Z	getLoggerr4rvrZ
EPOCH_TIMEZMAX_UPLOAD_SIZEr&�compilerNrQr!r)ZActionr*r�r8r>r9rTrVr`rgrm�objectrnryr^�curdirr�r�r�r�r�r�rkr�r�r�r�r�r�r�r�r�r�r�r�r�rrrr �<module>
s~
 ,



<