Hacked By AnonymousFox

Current Path : /proc/thread-self/root/proc/thread-self/root/proc/self/root/opt/imunify360/venv/lib64/python3.11/site-packages/defence360agent/utils/
Upload File :
Current File : //proc/thread-self/root/proc/thread-self/root/proc/self/root/opt/imunify360/venv/lib64/python3.11/site-packages/defence360agent/utils/safe_sequence.py

import os


def path(p: str):
    """
    Make safe sequence from path-like string

    Useful if p contains unprintable sequence

    If p is safe to be printed (e.g. via logger) return it as is
    If it can cause an exception, return bytes instead
    """

    try:
        p.encode()
    except UnicodeEncodeError:
        return os.fsencode(p)

    return p

Hacked By AnonymousFox1.0, Coded By AnonymousFox