| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/ |
Upload File : |
o
;j�C � @ sz d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlmZ e�
e�Zed�d9dd��Zd:dd �Zd:d
d�Zed�ed
�dd
� ��Zdd� Zdd� Zdd� Zed�dd� �Zdd� Zed�d;dd��Zed�dd� �Zed�d<d!d��Zd"d#� Zd$d%� Zed&�d=d'd&��Zd=d(d)�Zd>d,d-�Z d?d/d0�Z!d1d2� Z"ed3�d4d5� �Z#ed6�d@d7d8��Z$dS )Az<
Functions for manipulating or otherwise processing strings
� N)�jinja_filter�to_bytes�strictc C s� |du rdt f}t|ttf�s|f}|std��d}t| t�r!| S t| t�r*t| �S t| t�rS|D ]}z | �||�W S t yP } z|}W Y d}~q1d}~ww |�t
dt| �� ���)za
Given bytes, bytearray, str, or unicode (python 2), return bytes (str for
python 2)
N�utf-8�encoding cannot be empty�&expected str, bytes, or bytearray not )�__salt_system_encoding__�
isinstance�tuple�list�
ValueError�bytes� bytearray�str�encode�UnicodeEncodeError� TypeError�type)�s�encoding�errors�exc�enc�err� r �J/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/stringutils.pyr s,
��Fc s� � fdd�}|du rdt f}t|ttf�s|f}|std��t| t�r'|| �S d}t| ttf�rV|D ]!}z|| �||��W S t yS } z|}W Y d}~q2d}~ww |�t
dt| �� ���)zC
Given str, bytes, bytearray, or unicode (py2), return str
c s0 z� r
t �d| �W S | W S ty | Y S w �NZNFC)�unicodedata� normalizer �r �r r r �
_normalize<