OwlCyberSecurity - MANAGER
Edit File: utils.cpython-39.pyc
a ���ec � @ s8 d dl Z d dlZd dlmZ ddd�ZG dd� d�ZdS ) � N)�SuspiciousFileOperationFc C sj t j�| �dv rtd| ��|rJt�| �}|�� s<d|jv rftd| ��n| t j�| �krftd| ��| S )N> � �.�..z$Could not derive file name from '%s'r z'Detected path traversal attempt in '%s'z%File name '%s' includes path elements)�os�path�basenamer �pathlib� PurePosixPath�is_absolute�parts)�nameZallow_relative_pathr � r �X/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/django/core/files/utils.py�validate_file_name s �r c @ s� e Zd ZdZedd� �Zedd� �Zedd� �Zedd� �Zedd� �Z edd� �Z ed d� �Zed d� �Zedd� �Z edd� �Zed d� �Zedd� �Zedd� �Zedd� �Zedd� �Zdd� Zdd� Zdd� Zdd� ZdS )�FileProxyMixinz� A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file c C s | j jS �N)�file�encoding��selfr r r �<lambda>% � zFileProxyMixin.<lambda>c C s | j jS r )r �filenor r r r r &