HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/test/__pycache__/test_unicode_file_functions.cpython-38.opt-2.pyc
U

.D�g\�@s,ddlZddlZddlZddlZddlmZddlmZdddddd	d
ddd
g
Zej	dkrve�
dddddddddg	�ejjs�e�
�ZzeD]Ze�e�q�Wnek
r�e�d��YnXGdd�dej�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�Zd#d$�Zed%k�r(e�dS)&�N��	normalize)�supportZ1_abcZ2_asciiu
3_Grüß-Gottu4_Γειά-σαςu5_Здравствуйтеu6_にぽんu7_השקצץסu8_曨曩曫u9_曨שんдΓßu	10_΅´�darwinu	11_΅ϓϔu12_΅ϓϔu13_ ̈́ΎΫu14_ẛ῁῍῎῏῝῞῟῭u15_΅´𣏕u
16_   Au
17_   Au
18_   Az19_   Az>only NT+ and systems with Unicode-friendly filesystem encodingc@s�eZdZee�ZdZdd�Zdd�Ze	dfdd�Z
d	d
�Zej
dkrNee	fZneZdd
�Ze�ej
dkd�dd��Ze�ej
dkd�dd��Zdd�Zdd�ZdS)�UnicodeFileTestsNc
Cs�zt�tj�Wntk
r$YnX|�tjtj�t�}|jD]X}tj	�
tj|�|��}t|d��}|�
|d�d��W5QRXt�|�|�|�qB||_dS�N�wb�
�utf-8)�os�mkdirr�TESTFN�FileExistsErrorZ
addCleanup�rmtree�set�files�path�join�norm�open�write�encode�stat�add)�selfr�name�f�r�?/opt/cppython/lib/python3.8/test/test_unicode_file_functions.py�setUp?s

zUnicodeFileTests.setUpcCs|jrt|j|�S|S�N)�normal_formr)r�srrrrOszUnicodeFileTests.normTc	CsH|�|��}||�W5QRX|jj}|rD|�||d|j||f�dS)Nz>Function '%s(%a) failed with bad filename in the exception: %a)ZassertRaises�	exception�filename�assertEqual�__name__)r�fnr$Zexpected_exceptionZcheck_filename�cZexc_filenamerrr�_apply_failureTs

�zUnicodeFileTests._apply_failurecCsj|jD]^}d|}|�t|�|�tj|�|�tj|�|�tj|�|�tj|�|�tj|�qdS)N�not_)	rr)rrr�chdir�rmdir�remove�listdir�rrrrr�
test_failures_s
zUnicodeFileTests.test_failures�win32cCsR|jD]F}t|d�}|�|d�d��|��t�|�|�tj||j	�qdSr)
rrrr�closerrr)r.�_listdir_failure)rrrrrr�	test_openps


zUnicodeFileTests.test_openrzirrelevant test on Mac OS Xcs�t|j�}t�}tddddg�D]�|t�fdd�|D��O}q ||8}|D]V}|�t|�|�tj|�|�tj|�|�tj|�|�tj|�|�tj	|�qLdS)N�NFC�NFD�NFKC�NFKDc3s|]}t�|�VqdSr r)�.0�file�Znfrr�	<genexpr>�sz2UnicodeFileTests.test_normalize.<locals>.<genexpr>)
rrr)rrrr+r,r-r.)rrZothersrrr;r�test_normalize|s
zUnicodeFileTests.test_normalizec	Cs�t|j�}t���(t�dt�t�tj	�
t����}W5QRXt�tj	�}tdd�|D��}|�
||d||f�|�
t|�t|��dS)N�ignorecss|]}tj�tj|�VqdSr )rrrrr
)r9rrrrr<�sz0UnicodeFileTests.test_listdir.<locals>.<genexpr>z%a != %a)rr�warnings�catch_warnings�simplefilter�DeprecationWarningrr.rr
r�sys�getfilesystemencodingr%�len)rZsf0�f1�f2Zsf2rrr�test_listdir�s

 zUnicodeFileTests.test_listdircCs(|jD]}t�|d�t�d|�qdS)N�tmp)rr�renamer/rrr�test_rename�s
zUnicodeFileTests.test_renamec
Csptj�tjd�}d}t�|��Ht|d��}|�|d�d��W5QRXt�	|tj
�t�|�W5QRXdS)NuGrüß-曨曩曫uß-曨曩曫rr	r
)rrrrr
Ztemp_cwdrrr�access�R_OKr-)r�dirnamer$rrrr�test_directory�szUnicodeFileTests.test_directory)r&�
__module__�__qualname__r�	filenamesrr!rr�FileNotFoundErrorr)r0rC�platform�NotADirectoryErrorr3r4�unittestZskipIfr=rHrKrOrrrrr;s$�





rc@seZdZdZdS)�UnicodeNFCFileTestsr5N�r&rPrQr!rrrrrW�srWc@seZdZdZdS)�UnicodeNFDFileTestsr6NrXrrrrrY�srYc@seZdZdZdS)�UnicodeNFKCFileTestsr7NrXrrrrrZ�srZc@seZdZdZdS)�UnicodeNFKDFileTestsr8NrXrrrrr[�sr[cCst�ttttt�dSr )rZrun_unittestrrWrYrZr[rrrr�	test_main�s�r\�__main__)rrCrVr?�unicodedatar�testrrRrT�extendr�supports_unicode_filenamesrDZ
fsencodingrr�UnicodeEncodeErrorZSkipTestZTestCaserrWrYrZr[r\r&rrrr�<module>sV�
�m