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.10/test/__pycache__/test_unicode_file.cpython-310.pyc
o

�i��	@s�ddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZej
jsFz	e
�e���WneefyEe�d��wdd�ZGdd�dej�Zedkr]e��dSdS)	�N)�rmtree�
change_cwd�TESTFN_UNICODE�TESTFN_UNENCODABLE�create_empty_filez1No Unicode filesystem semantics on this platform.cCstj�|�r
t�|�dSdS�N)�os�path�exists�unlink)�filename�r
�3/usr/local/lib/python3.10/test/test_unicode_file.py�remove_if_existss�rc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestUnicodeFilesc
Cs>|�tj�|��|�tj�|��|�t�|tj��|�tj�tj�|���|�tj�tj�|���|�t�tj�|�tj��t�|d�t�	|d�t�	|t
�
�t
�
�f�|�||�|�tj�|�tj�t�t�
|��d�k�tj�tj�|��\}}t�|�}t�d|�}dd�|D�}|�||�dS)Ni�r�NFDcSsg|]}t�d|��qS)r)�unicodedata�	normalize)�.0�fr
r
r�
<listcomp>4sz/TestUnicodeFiles._do_single.<locals>.<listcomp>)�
assertTruerr	r
�isfile�access�R_OK�abspath�chmod�utime�time�_do_copyish�glob�escape�split�listdirrrZassertIn)�selfrr	�baseZ	file_listr
r
r�
_do_singles$&�
zTestUnicodeFiles._do_singlecCs^|�tj�|��t�||d�|�tj�|��|�tj�|d��t�|d|�|�tj�|d��|�tj�|��t�||d�t�|d�t�	||d�|�tj�
|��|�tj�
|d��t�	|d|�|�tj�
|d��|�tj�
|��t�||d�|�tj�|d��t�|d�|�tj�
|d��dS)Nz.new)rrr	r�renameZassertFalse�shutil�copyr�mover
�copy2)r$Z	filename1�	filename2r
r
rr9s&zTestUnicodeFiles._do_copyishc	Cs�tj�|�r
t|�t�|�z@t|��$t��}|}t�d|�}t�d|�}|�	tj�
|�|�Wd�n1s;wYWt�|�dSWt�|�dSt�|�w)Nr)rr	�isdirr�mkdirr�getcwdrrZassertEqual�basename�rmdir)r$Z	make_nameZ
chdir_nameZ
cwd_resultZname_resultr
r
r�
_do_directoryVs

�	�	zTestUnicodeFiles._do_directoryc	Cs�t|�t|�z|�|�Wt�|�nt�|�w|�tj�|��t�|tj	�}t�
|�z
|�|�Wt�|�dSt�|�wr)rrr&rrrr	r
�open�O_CREAT�close)r$rrr
r
r�_test_singlehs
zTestUnicodeFiles._test_singlecCs$|�t�tdur|�t�dSdSr)r6rr)r$r
r
r�test_single_fileszs
�z"TestUnicodeFiles.test_single_filescCs<d}|�t|t|�tdur|�t|t|�dSdS)Nz.dir)r2rr)r$�extr
r
r�test_directoriess
��z!TestUnicodeFiles.test_directoriesN)	�__name__�
__module__�__qualname__r&rr2r6r7r9r
r
r
rrsr�__main__)rr rr(�sysrZunittestZtest.support.os_helperrrrrrr	�supports_unicode_filenames�encode�getfilesystemencoding�UnicodeError�	TypeErrorZSkipTestrZTestCaserr:�mainr
r
r
r�<module>s  
�r�