HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_unicode_file_functions.cpython-37.opt-2.pyc
B

��g\�@s0ddlZddlZddlZddlZddlmZddlmZdddddd	d
ddd
g
Zej	dkrve�
dddddddddg	�ejjs�e�
�ZyxeD]Ze�e�q�WWnek
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�yt�tj�Wntk
r$YnX|�tjtj�t�}xb|jD]X}tj	�
tj|�|��}t|d��}|�
|d�d��WdQRXt�|�|�|�qDW||_dS)N�wb�
zutf-8)�os�mkdirr�TESTFN�FileExistsErrorZ
addCleanupZrmtree�set�files�path�join�norm�open�write�encode�stat�add)�selfr
�name�f�r�</usr/local/lib/python3.7/test/test_unicode_file_functions.py�setUp?s
zUnicodeFileTests.setUpcCs|jrt|j|�S|S)N)�normal_formr)r�srrrrOszUnicodeFileTests.normTc	CsH|�|��}||�WdQRX|jj}|rD|�||d|j||f�dS)Nz>Function '%s(%a) failed with bad filename in the exception: %a)ZassertRaisesZ	exception�filename�assertEqual�__name__)r�fnrZexpected_exceptionZcheck_filename�cZexc_filenamerrr�_apply_failureTs
zUnicodeFileTests._apply_failurecCsnxh|jD]^}d|}|�t|�|�tj|�|�tj|�|�tj|�|�tj|�|�tj|�qWdS)N�not_)	r
r#rrr�chdir�rmdir�remove�listdir)rrrrr�
test_failures_szUnicodeFileTests.test_failures�win32cCsVxP|jD]F}t|d�}|�|d�d��|��t�|�|�tj||j	�qWdS)Nrrzutf-8)
r
rrr�closerrr#r(�_listdir_failure)rrrrrr�	test_openps

zUnicodeFileTests.test_openrzirrelevant test on Mac OS Xcs�t|j�}t�}x2tddddg�D]�|t�fdd�|D��O}q"W||8}x^|D]V}|�t|�|�tj|�|�tj|�|�tj|�|�tj|�|�tj	|�qRWdS)N�NFC�NFD�NFKC�NFKDc3s|]}t�|�VqdS)N)r)�.0�file)�nfrr�	<genexpr>�sz2UnicodeFileTests.test_normalize.<locals>.<genexpr>)
rr
r#rrrr%r&r'r()rr
Zothersrr)r4r�test_normalize|s

zUnicodeFileTests.test_normalizec	Cs�t|j�}t���(t�dt�t�tj	�
t����}WdQRXt�tj	�}tdd�|D��}|�
||d||f�|�
t|�t|��dS)N�ignorecss|]}tj�tj|�VqdS)N)rrrrr
)r2rrrrr5�sz0UnicodeFileTests.test_listdir.<locals>.<genexpr>z%a != %a)rr
�warnings�catch_warnings�simplefilter�DeprecationWarningrr(rr
r�sys�getfilesystemencodingr�len)rZsf0�f1�f2Zsf2rrr�test_listdir�s

 zUnicodeFileTests.test_listdircCs,x&|jD]}t�|d�t�d|�qWdS)NZtmp)r
r�rename)rrrrr�test_rename�szUnicodeFileTests.test_renamec
Csptj�tjd�}d}t�|��Ht|d��}|�|d�d��WdQRXt�	|tj
�t�|�WdQRXdS)NuGrüß-曨曩曫uß-曨曩曫rrzutf-8)rrrrr
Ztemp_cwdrrr�access�R_OKr')r�dirnamerrrrr�test_directory�szUnicodeFileTests.test_directory)r �
__module__�__qualname__r�	filenamesr
rrr�FileNotFoundErrorr#r)r<�platform�NotADirectoryErrorr,r-�unittestZskipIfr6rArCrGrrrrr;s	

rc@seZdZdZdS)�UnicodeNFCFileTestsr.N)r rHrIrrrrrrO�srOc@seZdZdZdS)�UnicodeNFDFileTestsr/N)r rHrIrrrrrrP�srPc@seZdZdZdS)�UnicodeNFKCFileTestsr0N)r rHrIrrrrrrQ�srQc@seZdZdZdS)�UnicodeNFKDFileTestsr1N)r rHrIrrrrrrR�srRcCst�ttttt�dS)N)rZrun_unittestrrOrPrQrRrrrr�	test_main�srS�__main__)rr<rNr8ZunicodedatarZtestrrJrL�extendr�supports_unicode_filenamesr=Z
fsencodingrr�UnicodeEncodeErrorZSkipTestZTestCaserrOrPrQrRrSr rrrr�<module>sR	

m