File: //usr/local/CyberCP/lib64/python3.10/site-packages/django/utils/__pycache__/_os.cpython-310.pyc
o
�h � @ s` d dl Z d dlZd dlmZmZmZmZmZ d dlm Z d dl
mZ dd� Zdd� Z
d d
� ZdS )� N)�abspath�dirname�join�normcase�sep)�Path)�SuspiciousFileOperationc G sj t t| g|�R � �}t | �}t|��t|t ��s3t|�t|�kr3tt|��t|�kr3td�||���|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_path� r �C/usr/local/CyberCP/lib/python3.10/site-packages/django/utils/_os.py� safe_join s ��r c
C s� t �� �5} tj�| d�}tj�| d�}t�|� z
t�||� d}W n
ttfy/ d}Y nw |W d � S 1 s<w Y dS )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� supportedr r r �symlinks_supported&