
     h	                     \    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dS )    N)abspathdirnamejoinnormcasesep)Path)SuspiciousFileOperationc                    t          t          | g|R            }t          |           }t          |                              t          |t          z                       spt          |          t          |          k    rPt          t          |                    t          |          k    r#t          d                    ||                    |S )z
    Join one or more path components to the base path component intelligently.
    Return a normalized, absolute version of the final path.

    Raise ValueError 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       O/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/django/utils/_os.py	safe_joinr   	   s     d+U+++,,JI Z  ++HY_,E,EFF
Z  HY$7$777HY''((HY,?,???%#VJ	::
 
 	
     c                  l   t          j                    5 } t          j                            | d          }t          j                            | d          }t          j        |           	 t          j        ||           d}n# t          t          f$ r d}Y nw xY w|cddd           S # 1 swxY w Y   dS )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::w||Hi88
M"""	J}l333II,- 	 	 	III		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s6   AB)*BB)BB)BB))B-0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   sV    % Hs## H/$u++2FFG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 9 9 9 9 9 9 9 9 9 9 9 9       : : : : : :  :  $    r   