
    h	                     Z    S SK r S SKrS SKJrJrJrJrJr  S SKJ	r	  S SK
Jr  S rS rS rg)    N)abspathdirnamejoinnormcasesep)Path)SuspiciousFileOperationc                 J   [        [        U /UQ76 5      n[        U 5      n[        U5      R                  [        U[        -   5      5      (       dS  [        U5      [        U5      :w  a;  [        [        U5      5      [        U5      :w  a  [        SR                  X#5      5      eU$ )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       B/var/www/html/env/lib/python3.13/site-packages/django/utils/_os.py	safe_joinr   	   s     d+U+,JI Z ++HY_,EFFZ HY$77HY'(HY,??%#VJ:
 	
     c                  t   [         R                  " 5        n [        R                  R	                  U S5      n[        R                  R	                  U S5      n[        R
                  " U5         [        R                  " X5        SnUsSSS5        $ ! [        [        4 a    Sn Nf = f! , (       d  f       g= f)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}3I  
'	& ,- 	I	 
'	&s0   AB).BB)B&#B)%B&&B))
B7c                     [        U [        5      (       a  U $ [        U [        5      (       d!  [        S[	        U 5      R
                  -  5      e[        U 5      $ )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   sF    %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   