← Back
Editing: _os.cpython-311.pyc
� �|�e� � �\ � d dl Z d dlZd dlmZmZmZmZmZ d dlm Z d dl mZ d� Zd� Z d� ZdS )� 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 �2/usr/lib/python3/dist-packages/django/utils/_os.py� safe_joinr s� � � ��d�+�U�+�+�+�,�,�J��� � �I� �Z� � �+�+�H�Y��_�,E�,E�F�F� <��Z� � �H�Y�$7�$7�7�7��H�Y�'�'�(�(�H�Y�,?�,?�?�?�%� �#�V�J� �:�:�<� <� <� �� c �l � t j � � 5 } t j � | d� � }t j � | d� � }t j |� � t j ||� � d}n# t t f$ r d}Y nw xY w|cddd� � S # 1 swxY 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� supporteds r �symlinks_supportedr"