o
    Wia                     @  s   d dl mZ d dlZd dlZd dlZd dlmZ d dlmZm	Z	 er(d dl
mZ eeZdd
dZdddZdddZddgZdS )    )annotationsN)TYPE_CHECKING)IS_WINROOT)Path	full_path
str | Pathreturnstrc              	   C  s   t | }ttd,}||}| dW  d    W  d    S 1 s)w   Y  W d    d S 1 s9w   Y  d S )Nrzutf-8)_get_path_within_zipzipfileZipFiler   openreaddecode)r   sub_filezip_filefile_handler r   J/home/ubuntu/.local/lib/python3.10/site-packages/virtualenv/util/zipapp.pyr      s   Rr   destr   Nonec                 C  sl   t d| | t| }ttd}||}|j|_|	|t
|j W d    d S 1 s/w   Y  d S )Nzextract %s to %sr   )LOGGERdebugr   r   r   r   getinfonamefilenameextractr
   parent)r   r   r   r   infor   r   r   r      s   
"r   c                 C  sp   t jt jt| } t t j }| |s%d|  d| d}t|| t	|d  }t
r6|t jd}|S )Nz
full_path=z should start with prefix=./)ospathrealpathabspathr
   r   sep
startswithRuntimeErrorlenr   replace)r   prefixmsgr   r   r   r   r      s   
r   )r   r   r	   r
   )r   r   r   r   r	   r   )
__future__r   loggingr#   r   typingr   virtualenv.infor   r   pathlibr   	getLogger__name__r   r   r   r   __all__r   r   r   r   <module>   s    



	