B
    ª0H[ƒ	  ã               @   sl   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 eZdd„ Zdd„ Zd	d
„ Zdd„ ZdS )é    N)ÚabspathÚdirnameÚjoinÚnormcaseÚsep)ÚSuspiciousFileOperation)Ú
force_textc             C   s   | S )z:Always return a unicode path (did something for Python 2).© )Úpathr	   r	   úTC:\Users\HIRONO~1\AppData\Local\Temp\pip-install-6bm3nxem\django\django\utils\_os.pyÚupath   s    r   c             C   s   | S )zu
    Always return a native path, that is unicode on Python 3 and bytestring on
    Python 2. Noop for Python 3.
    r	   )r
   r	   r	   r   Únpath   s    r   c             G   s~   t | ƒ} dd„ |D ƒ}tt| f|žŽ ƒ}t| ƒ}t|ƒ t|t ƒ¡szt|ƒt|ƒkrztt|ƒƒt|ƒkrzt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.
    c             S   s   g | ]}t |ƒ‘qS r	   )r   )Ú.0Úpr	   r	   r   ú
<listcomp>"   s    zsafe_join.<locals>.<listcomp>zGThe joined path ({}) is located outside of the base path component ({}))	r   r   r   r   Ú
startswithr   r   r   Úformat)ÚbaseÚpathsZ
final_pathÚ	base_pathr	   r	   r   Ú	safe_join   s    
r   c           
   C   sp   t  ¡ �^} tj | d¡}tj | d¡}t |¡ yt ||¡ d}W n ttfk
r`   d}Y nX |S Q R X 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Úosr
   r   Úmakedirsr   ÚOSErrorÚNotImplementedError)Útemp_dirZoriginal_pathZsymlink_pathÚ	supportedr	   r	   r   Úsymlinks_supported5   s    


r!   )r   r   Úos.pathr   r   r   r   r   Zdjango.core.exceptionsr   Zdjango.utils.encodingr   Zabspathur   r   r   r!   r	   r	   r	   r   Ú<module>   s   