
    g	                     Z    d dl Z d dlZd dlmZmZmZmZmZ d dlm	Z	 d dl
mZ d Zd Zd Zy)    N)abspathdirnamejoinnormcasesep)Path)SuspiciousFileOperationc                 >   t        t        | g|       }t        |       }t        |      j                  t        |t        z               sRt        |      t        |      k7  r;t        t        |            t        |      k7  rt        dj                  ||            |S )z
    Join one or more path components to the base path component intelligently.
    Return a normalized, absolute version of the final path.

    Raise SuspiciousFileOperation if the final path isn't located inside of the
    base path component.
    zGThe joined path ({}) is located outside of the base path component ({}))r   r   r   
startswithr   r   r	   format)basepaths
final_path	base_paths       h/var/www/python.vincentserveurtest.ovh/public_html/venv/lib/python3.12/site-packages/django/utils/_os.py	safe_joinr   	   s     d+U+,JI Z ++HY_,EFZ HY$77HY'(HY,??%#VJ	:
 	
     c                  d   t        j                         5 } t        j                  j	                  | d      }t        j                  j	                  | d      }t        j
                  |       	 t        j                  ||       d}|cddd       S # t        t        f$ r d}Y w xY w# 1 sw Y   yxY w)z
    Return whether or not creating symlinks are supported in the host platform
    and/or if they are allowed to be created (e.g. on Windows it requires admin
    permissions).
    originalsymlinkTFN)	tempfileTemporaryDirectoryospathr   makedirsr   OSErrorNotImplementedError)temp_diroriginal_pathsymlink_path	supporteds       r   symlinks_supportedr"   &   s     
	$	$	&(Xz:ww||Hi8
M"	JJ}l3I  
'	& ,- 	I	 
'	&s0   AB&,BB&B# B&"B##B&&B/c                     t        | t              r| S t        | t              s!t        dt	        |       j
                  z        t        |       S )z@Convert value to a pathlib.Path instance, if not already a Path.zInvalid path type: %s)
isinstancer   str	TypeErrortype__name__)values    r   to_pathr*   8   s@    %s#/$u+2F2FFGG;r   )r   r   os.pathr   r   r   r   r   pathlibr   django.core.exceptionsr	   r   r"   r*    r   r   <module>r/      s&    	  9 9  ::$r   