Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_os fails on Windows #118802

Closed
Eclips4 opened this issue May 8, 2024 · 6 comments
Closed

test_os fails on Windows #118802

Eclips4 opened this issue May 8, 2024 · 6 comments
Assignees
Labels
OS-windows tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented May 8, 2024

Bug report

Bug description:

./python.bat -m test -v test_os        
Running Debug|x64 interpreter...
== CPython 3.14.0a0 (heads/bump_lib_version-dirty:a8d31d432c, May 8 2024, 23:21:14) [MSC v.1933 64 bit (AMD64)]
== Windows-10-10.0.19043-SP0 little-endian
== Python build: debug
== cwd: C:\Users\KIRILL-1\CLionProjects\cpython\build\test_python_worker_6120æ
== CPU count: 16
== encodings: locale=cp1251 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests  

Using random seed: 2053563363
0:00:00 Run 1 test sequentially
0:00:00 [1/1] test_os
test_blocking (test.test_os.BlockingTests.test_blocking) ... skipped 'Windows only supports blocking on pipes'test_compare_to_walk (test.test_os.BytesFwalkTests.test_compare_to_walk) ... skipped 'Test needs os.fwalk()'  
test_dir_fd (test.test_os.BytesFwalkTests.test_dir_fd) ... skipped 'Test needs os.fwalk()'
test_fd_leak (test.test_os.BytesFwalkTests.test_fd_leak) ... skipped 'Test needs os.fwalk()'
test_file_like_path (test.test_os.BytesFwalkTests.test_file_like_path) ... skipped 'Test needs os.fwalk()'    
test_walk_bad_dir (test.test_os.BytesFwalkTests.test_walk_bad_dir) ... skipped 'Test needs os.fwalk()'        
test_walk_bad_dir2 (test.test_os.BytesFwalkTests.test_walk_bad_dir2) ... skipped 'Test needs os.fwalk()'      
test_walk_bottom_up (test.test_os.BytesFwalkTests.test_walk_bottom_up) ... skipped 'Test needs os.fwalk()'    
test_walk_named_pipe (test.test_os.BytesFwalkTests.test_walk_named_pipe) ... skipped 'Test needs os.fwalk()'  
test_walk_named_pipe2 (test.test_os.BytesFwalkTests.test_walk_named_pipe2) ... skipped 'Test needs os.fwalk()'test_walk_prune (test.test_os.BytesFwalkTests.test_walk_prune) ... skipped 'Test needs os.fwalk()'
test_walk_symlink (test.test_os.BytesFwalkTests.test_walk_symlink) ... skipped 'Test needs os.fwalk()'        
test_walk_topdown (test.test_os.BytesFwalkTests.test_walk_topdown) ... skipped 'Test needs os.fwalk()'        
test_yields_correct_dir_fd (test.test_os.BytesFwalkTests.test_yields_correct_dir_fd) ... skipped 'Test needs os.fwalk()'
test_file_like_path (test.test_os.BytesWalkTests.test_file_like_path) ... ok
test_walk_above_recursion_limit (test.test_os.BytesWalkTests.test_walk_above_recursion_limit) ... ok
test_walk_bad_dir (test.test_os.BytesWalkTests.test_walk_bad_dir) ... ok
test_walk_bad_dir2 (test.test_os.BytesWalkTests.test_walk_bad_dir2) ... ok
test_walk_bottom_up (test.test_os.BytesWalkTests.test_walk_bottom_up) ... ok
test_walk_many_open_files (test.test_os.BytesWalkTests.test_walk_many_open_files) ... ok
test_walk_named_pipe (test.test_os.BytesWalkTests.test_walk_named_pipe) ... skipped 'requires os.mkfifo()'
test_walk_named_pipe2 (test.test_os.BytesWalkTests.test_walk_named_pipe2) ... skipped 'requires os.mkfifo()'  
test_walk_prune (test.test_os.BytesWalkTests.test_walk_prune) ... ok
test_walk_symlink (test.test_os.BytesWalkTests.test_walk_symlink) ... skipped 'need symlink support'
test_walk_topdown (test.test_os.BytesWalkTests.test_walk_topdown) ... ok
test_cpu_count (test.test_os.CPUCountTests.test_cpu_count) ... ok
test_process_cpu_count (test.test_os.CPUCountTests.test_process_cpu_count) ... ok
test_process_cpu_count_affinity (test.test_os.CPUCountTests.test_process_cpu_count_affinity) ... skipped "don't have sched affinity support"
test_chown_gid (test.test_os.ChownFileTests.test_chown_gid) ... skipped 'requires os.chown()'
test_chown_uid_gid_arguments_must_be_index (test.test_os.ChownFileTests.test_chown_uid_gid_arguments_must_be_index) ... skipped 'requires os.chown()'
test_chown_with_root (test.test_os.ChownFileTests.test_chown_with_root) ... skipped 'requires os.chown()'     
test_chown_without_permission (test.test_os.ChownFileTests.test_chown_without_permission) ... skipped 'requires os.chown()'
test_devnull (test.test_os.DevNullTests.test_devnull) ... ok
test_bad_fd (test.test_os.DeviceEncodingTests.test_bad_fd) ... ok
test_device_encoding (test.test_os.DeviceEncodingTests.test_device_encoding) ... ok
test___repr__ (test.test_os.EnvironTests.test___repr__)
Check that the repr() of os.environ looks like environ({...}). ... ok
test_bool (test.test_os.EnvironTests.test_bool) ... ok
test_constructor (test.test_os.EnvironTests.test_constructor) ... ok
test_environb (test.test_os.EnvironTests.test_environb) ... skipped 'os.environb required for this test.'     
test_get (test.test_os.EnvironTests.test_get) ... ok
test_get_exec_path (test.test_os.EnvironTests.test_get_exec_path) ... ok
test_getitem (test.test_os.EnvironTests.test_getitem) ... ok
test_ior_operator (test.test_os.EnvironTests.test_ior_operator) ... ok
test_ior_operator_invalid_dicts (test.test_os.EnvironTests.test_ior_operator_invalid_dicts) ... ok
test_ior_operator_key_value_iterable (test.test_os.EnvironTests.test_ior_operator_key_value_iterable) ... ok  
test_items (test.test_os.EnvironTests.test_items) ... ok
test_iter_error_when_changing_os_environ (test.test_os.EnvironTests.test_iter_error_when_changing_os_environ) 
... ok
test_iter_error_when_changing_os_environ_items (test.test_os.EnvironTests.test_iter_error_when_changing_os_environ_items) ... ok
test_iter_error_when_changing_os_environ_values (test.test_os.EnvironTests.test_iter_error_when_changing_os_environ_values) ... ok
test_key_type (test.test_os.EnvironTests.test_key_type) ... ok
test_keys (test.test_os.EnvironTests.test_keys) ... ok
test_keyvalue_types (test.test_os.EnvironTests.test_keyvalue_types) ... ok
test_len (test.test_os.EnvironTests.test_len) ... ok
test_or_operator (test.test_os.EnvironTests.test_or_operator) ... ok
test_os_popen_iter (test.test_os.EnvironTests.test_os_popen_iter) ... skipped 'requires a shell'
test_pop (test.test_os.EnvironTests.test_pop) ... ok
test_popitem (test.test_os.EnvironTests.test_popitem) ... ok
test_putenv_unsetenv (test.test_os.EnvironTests.test_putenv_unsetenv) ... ok
test_putenv_unsetenv_error (test.test_os.EnvironTests.test_putenv_unsetenv_error) ... ok
test_read (test.test_os.EnvironTests.test_read) ... ok
test_ror_operator (test.test_os.EnvironTests.test_ror_operator) ... ok
test_setdefault (test.test_os.EnvironTests.test_setdefault) ... ok
test_update (test.test_os.EnvironTests.test_update) ... ok
test_update2 (test.test_os.EnvironTests.test_update2) ... skipped 'requires a shell'
test_values (test.test_os.EnvironTests.test_values) ... ok
test_write (test.test_os.EnvironTests.test_write) ... ok
test_eventfd_initval (test.test_os.EventfdTests.test_eventfd_initval) ... skipped 'requires os.eventfd'       
test_eventfd_select (test.test_os.EventfdTests.test_eventfd_select) ... skipped 'requires os.eventfd'
test_eventfd_semaphore (test.test_os.EventfdTests.test_eventfd_semaphore) ... skipped 'requires os.eventfd'   
test_execv_with_bad_arglist (test.test_os.ExecTests.test_execv_with_bad_arglist) ... ok
test_execve_invalid_env (test.test_os.ExecTests.test_execve_invalid_env) ... ok
test_execve_with_empty_path (test.test_os.ExecTests.test_execve_with_empty_path) ... ok
test_execvpe_with_bad_arglist (test.test_os.ExecTests.test_execvpe_with_bad_arglist) ... ok
test_execvpe_with_bad_program (test.test_os.ExecTests.test_execvpe_with_bad_program) ... ok
test_internal_execvpe_str (test.test_os.ExecTests.test_internal_execvpe_str) ... ok
test_os_all (test.test_os.ExportsTests.test_os_all) ... ok
test_fds (test.test_os.ExtendedAttributeTests.test_fds) ... skipped 'no non-broken extended attribute support'test_lpath (test.test_os.ExtendedAttributeTests.test_lpath) ... skipped 'no non-broken extended attribute support'
test_simple (test.test_os.ExtendedAttributeTests.test_simple) ... skipped 'no non-broken extended attribute support'
test_dup (test.test_os.FDInheritanceTests.test_dup) ... ok
test_dup2 (test.test_os.FDInheritanceTests.test_dup2) ... ok
test_dup_nul (test.test_os.FDInheritanceTests.test_dup_nul) ... ok
test_dup_standard_stream (test.test_os.FDInheritanceTests.test_dup_standard_stream) ... ok
test_get_inheritable_cloexec (test.test_os.FDInheritanceTests.test_get_inheritable_cloexec) ... skipped 'need 
fcntl'
test_get_set_inheritable (test.test_os.FDInheritanceTests.test_get_set_inheritable) ... ok
test_get_set_inheritable_badf (test.test_os.FDInheritanceTests.test_get_set_inheritable_badf) ... ok
test_get_set_inheritable_o_path (test.test_os.FDInheritanceTests.test_get_set_inheritable_o_path) ... skipped 
'need os.O_PATH'
test_open (test.test_os.FDInheritanceTests.test_open) ... ok
test_pipe (test.test_os.FDInheritanceTests.test_pipe) ... ok
test_set_inheritable_cloexec (test.test_os.FDInheritanceTests.test_set_inheritable_cloexec) ... skipped 'need 
fcntl'
test_identity (test.test_os.FSEncodingTests.test_identity) ... ok
test_nop (test.test_os.FSEncodingTests.test_nop) ... ok
test_access (test.test_os.FileTests.test_access) ... ok
test_closerange (test.test_os.FileTests.test_closerange) ... ok
test_copy_file_range (test.test_os.FileTests.test_copy_file_range) ... skipped 'test needs os.copy_file_range()'
test_copy_file_range_invalid_values (test.test_os.FileTests.test_copy_file_range_invalid_values) ... skipped 'test needs os.copy_file_range()'
test_copy_file_range_offset (test.test_os.FileTests.test_copy_file_range_offset) ... skipped 'test needs os.copy_file_range()'
test_fdopen (test.test_os.FileTests.test_fdopen) ... ok
test_large_read (test.test_os.FileTests.test_large_read) ... skipped 'not enough memory: 2.0G minimum needed' 
test_open_keywords (test.test_os.FileTests.test_open_keywords) ... ok
test_read (test.test_os.FileTests.test_read) ... ok
test_rename (test.test_os.FileTests.test_rename) ... ok
test_replace (test.test_os.FileTests.test_replace) ... ok
test_splice (test.test_os.FileTests.test_splice) ... skipped 'test needs os.splice()'
test_splice_invalid_values (test.test_os.FileTests.test_splice_invalid_values) ... skipped 'test needs os.splice()'
test_splice_offset_in (test.test_os.FileTests.test_splice_offset_in) ... skipped 'test needs os.splice()'     
test_splice_offset_out (test.test_os.FileTests.test_splice_offset_out) ... skipped 'test needs os.splice()'   
test_symlink_keywords (test.test_os.FileTests.test_symlink_keywords) ... ok
test_write (test.test_os.FileTests.test_write) ... ok
test_write_windows_console (test.test_os.FileTests.test_write_windows_console) ... ok
test_fork (test.test_os.ForkTests.test_fork) ... skipped 'requires working os.fork()'
test_fork_at_finalization (test.test_os.ForkTests.test_fork_at_finalization) ... skipped 'requires working os.fork()'
test_fork_warns_when_non_python_thread_exists (test.test_os.ForkTests.test_fork_warns_when_non_python_thread_exists) ... skipped 'requires working os.fork()'
test_compare_to_walk (test.test_os.FwalkTests.test_compare_to_walk) ... skipped 'Test needs os.fwalk()'       
test_dir_fd (test.test_os.FwalkTests.test_dir_fd) ... skipped 'Test needs os.fwalk()'
test_fd_leak (test.test_os.FwalkTests.test_fd_leak) ... skipped 'Test needs os.fwalk()'
test_file_like_path (test.test_os.FwalkTests.test_file_like_path) ... skipped 'Test needs os.fwalk()'
test_walk_bad_dir (test.test_os.FwalkTests.test_walk_bad_dir) ... skipped 'Test needs os.fwalk()'
test_walk_bad_dir2 (test.test_os.FwalkTests.test_walk_bad_dir2) ... skipped 'Test needs os.fwalk()'
test_walk_bottom_up (test.test_os.FwalkTests.test_walk_bottom_up) ... skipped 'Test needs os.fwalk()'
test_walk_named_pipe (test.test_os.FwalkTests.test_walk_named_pipe) ... skipped 'Test needs os.fwalk()'       
test_walk_named_pipe2 (test.test_os.FwalkTests.test_walk_named_pipe2) ... skipped 'Test needs os.fwalk()'     
test_walk_prune (test.test_os.FwalkTests.test_walk_prune) ... skipped 'Test needs os.fwalk()'
test_walk_symlink (test.test_os.FwalkTests.test_walk_symlink) ... skipped 'Test needs os.fwalk()'
test_walk_topdown (test.test_os.FwalkTests.test_walk_topdown) ... skipped 'Test needs os.fwalk()'
test_yields_correct_dir_fd (test.test_os.FwalkTests.test_yields_correct_dir_fd) ... skipped 'Test needs os.fwalk()'
test_getrandom0 (test.test_os.GetRandomTests.test_getrandom0) ... skipped 'need os.getrandom()'
test_getrandom_nonblock (test.test_os.GetRandomTests.test_getrandom_nonblock) ... skipped 'need os.getrandom()'
test_getrandom_random (test.test_os.GetRandomTests.test_getrandom_random) ... skipped 'need os.getrandom()'   
test_getrandom_type (test.test_os.GetRandomTests.test_getrandom_type) ... skipped 'need os.getrandom()'       
test_getrandom_value (test.test_os.GetRandomTests.test_getrandom_value) ... skipped 'need os.getrandom()'     
test_link (test.test_os.LinkTests.test_link) ... ok
test_link_bytes (test.test_os.LinkTests.test_link_bytes) ... ok
test_unicode_name (test.test_os.LinkTests.test_unicode_name) ... ok
test_getlogin (test.test_os.LoginTests.test_getlogin) ... skipped 'Skip due to platform/environment differences on *NIX buildbots'
test_exist_ok_existing_directory (test.test_os.MakedirTests.test_exist_ok_existing_directory) ... ok
test_exist_ok_existing_regular_file (test.test_os.MakedirTests.test_exist_ok_existing_regular_file) ... ok    
test_exist_ok_s_isgid_directory (test.test_os.MakedirTests.test_exist_ok_s_isgid_directory) ... skipped 'No support for S_ISGID dir mode.'
test_makedir (test.test_os.MakedirTests.test_makedir) ... ok
test_mode (test.test_os.MakedirTests.test_mode) ... ok
test_win32_mkdir_700 (test.test_os.MakedirTests.test_win32_mkdir_700) ... ok
test_memfd_create (test.test_os.MemfdCreateTests.test_memfd_create) ... skipped 'requires os.memfd_create'    
test_getcwd (test.test_os.MiscTests.test_getcwd) ... ok
test_getcwd_long_path (test.test_os.MiscTests.test_getcwd_long_path) ... Tested current directory length: 48  
ok
test_getcwdb (test.test_os.MiscTests.test_getcwdb) ... ok
test_directory_link_nonlocal (test.test_os.NonLocalSymlinkTests.test_directory_link_nonlocal)
The symlink target should resolve relative to the link, not relative ... skipped 'Requires functional symlink 
implementation'
test_oserror_filename (test.test_os.OSErrorTests.test_oserror_filename) ... ok
test_path_t_converter (test.test_os.PathTConverterTests.test_path_t_converter) ... ok
test_path_t_converter_and_custom_class (test.test_os.PathTConverterTests.test_path_t_converter_and_custom_class) ... ok
test_listdir (test.test_os.Pep383Tests.test_listdir) ... skipped 'Posix specific tests'
test_open (test.test_os.Pep383Tests.test_open) ... skipped 'Posix specific tests'
test_stat (test.test_os.Pep383Tests.test_stat) ... skipped 'Posix specific tests'
test_statvfs (test.test_os.Pep383Tests.test_statvfs) ... skipped 'Posix specific tests'
test_getppid (test.test_os.PidTests.test_getppid) ... ok
test_waitpid (test.test_os.PidTests.test_waitpid) ... ok
test_waitpid_windows (test.test_os.PidTests.test_waitpid_windows) ... ok
test_waitstatus_to_exitcode (test.test_os.PidTests.test_waitstatus_to_exitcode) ... ok
test_waitstatus_to_exitcode_kill (test.test_os.PidTests.test_waitstatus_to_exitcode_kill) ... skipped 'need signal.SIGKILL'
test_waitstatus_to_exitcode_windows (test.test_os.PidTests.test_waitstatus_to_exitcode_windows) ... ok        
test_setegid (test.test_os.PosixUidGidTests.test_setegid) ... skipped 'Posix specific tests'
test_seteuid (test.test_os.PosixUidGidTests.test_seteuid) ... skipped 'Posix specific tests'
test_setgid (test.test_os.PosixUidGidTests.test_setgid) ... skipped 'Posix specific tests'
test_setregid (test.test_os.PosixUidGidTests.test_setregid) ... skipped 'Posix specific tests'
test_setregid_neg1 (test.test_os.PosixUidGidTests.test_setregid_neg1) ... skipped 'Posix specific tests'      
test_setreuid (test.test_os.PosixUidGidTests.test_setreuid) ... skipped 'Posix specific tests'
test_setreuid_neg1 (test.test_os.PosixUidGidTests.test_setreuid_neg1) ... skipped 'Posix specific tests'      
test_setuid (test.test_os.PosixUidGidTests.test_setuid) ... skipped 'Posix specific tests'
test_set_get_priority (test.test_os.ProgramPriorityTests.test_set_get_priority) ... skipped 'needs os.getpriority and os.setpriority'
test_open_via_ptsname (test.test_os.PseudoterminalTests.test_open_via_ptsname) ... skipped 'need os.openpty()'test_openpty (test.test_os.PseudoterminalTests.test_openpty) ... skipped 'need os.openpty()'
test_pipe_spawnl (test.test_os.PseudoterminalTests.test_pipe_spawnl) ... skipped 'need os.openpty()'
test_posix_pty_functions (test.test_os.PseudoterminalTests.test_posix_pty_functions) ... skipped 'need os.openpty()'
test_bytes (test.test_os.ReadlinkTests.test_bytes) ... skipped 'Requires functional symlink implementation'   
test_missing_link (test.test_os.ReadlinkTests.test_missing_link) ... ok
test_not_symlink (test.test_os.ReadlinkTests.test_not_symlink) ... ok
test_pathlike (test.test_os.ReadlinkTests.test_pathlike) ... skipped 'Requires functional symlink implementation'
test_pathlike_bytes (test.test_os.ReadlinkTests.test_pathlike_bytes) ... skipped 'Requires functional symlink 
implementation'
test_remove_all (test.test_os.RemoveDirsTests.test_remove_all) ... ok
test_remove_nothing (test.test_os.RemoveDirsTests.test_remove_nothing) ... ok
test_remove_partial (test.test_os.RemoveDirsTests.test_remove_partial) ... ok
test_nowait (test.test_os.SpawnTests.test_nowait) ... ok
test_spawnl (test.test_os.SpawnTests.test_spawnl) ... ok
test_spawnl_noargs (test.test_os.SpawnTests.test_spawnl_noargs) ... ok
test_spawnle (test.test_os.SpawnTests.test_spawnle) ... ok
test_spawnle_noargs (test.test_os.SpawnTests.test_spawnle_noargs) ... ok
test_spawnlp (test.test_os.SpawnTests.test_spawnlp) ... skipped 'requires os.spawnlp'
test_spawnlpe (test.test_os.SpawnTests.test_spawnlpe) ... skipped 'requires os.spawnlpe'
test_spawnv (test.test_os.SpawnTests.test_spawnv) ... ok
test_spawnv_noargs (test.test_os.SpawnTests.test_spawnv_noargs) ... ok
test_spawnve (test.test_os.SpawnTests.test_spawnve) ... ok
test_spawnve_bytes (test.test_os.SpawnTests.test_spawnve_bytes) ... ok
test_spawnve_invalid_env (test.test_os.SpawnTests.test_spawnve_invalid_env) ... ok
test_spawnve_noargs (test.test_os.SpawnTests.test_spawnve_noargs) ... ok
test_spawnvp (test.test_os.SpawnTests.test_spawnvp) ... skipped 'requires os.spawnvp'
test_spawnvpe (test.test_os.SpawnTests.test_spawnvpe) ... skipped 'requires os.spawnvpe'
test_spawnvpe_invalid_env (test.test_os.SpawnTests.test_spawnvpe_invalid_env) ... skipped 'requires os.spawnvpe'
test_15261 (test.test_os.StatAttributeTests.test_15261) ... ok
test_1686475 (test.test_os.StatAttributeTests.test_1686475) ... ok
test_access_denied (test.test_os.StatAttributeTests.test_access_denied) ... ok
test_file_attributes (test.test_os.StatAttributeTests.test_file_attributes) ... ok
test_stat_attributes (test.test_os.StatAttributeTests.test_stat_attributes) ... ok
test_stat_attributes_bytes (test.test_os.StatAttributeTests.test_stat_attributes_bytes) ... ok
test_stat_block_device (test.test_os.StatAttributeTests.test_stat_block_device) ... ok
test_stat_result_pickle (test.test_os.StatAttributeTests.test_stat_result_pickle) ... ok
test_statvfs_attributes (test.test_os.StatAttributeTests.test_statvfs_attributes) ... skipped 'test needs os.statvfs()'
test_statvfs_result_pickle (test.test_os.StatAttributeTests.test_statvfs_result_pickle) ... skipped 'need os.statvfs()'
test_does_not_crash (test.test_os.TermsizeTests.test_does_not_crash)
Check if get_terminal_size() returns a meaningful value. ... ok
test_stty_match (test.test_os.TermsizeTests.test_stty_match)
Check if stty returns the same results ... skipped 'stty invocation failed'
test_windows_fd (test.test_os.TermsizeTests.test_windows_fd)
Check if get_terminal_size() returns a meaningful value in Windows ... ok
test_uninstantiable (test.test_os.TestDirEntry.test_uninstantiable) ... ok
test_unpickable (test.test_os.TestDirEntry.test_unpickable) ... ok
test_blocking (test.test_os.TestInvalidFD.test_blocking) ... ok
test_closerange (test.test_os.TestInvalidFD.test_closerange) ... ok
test_dup (test.test_os.TestInvalidFD.test_dup) ... ok
test_dup2 (test.test_os.TestInvalidFD.test_dup2) ... ok
test_dup2_negative_fd (test.test_os.TestInvalidFD.test_dup2_negative_fd) ... ok
test_fchdir (test.test_os.TestInvalidFD.test_fchdir) ... ok
test_fchmod (test.test_os.TestInvalidFD.test_fchmod) ... ok
test_fchown (test.test_os.TestInvalidFD.test_fchown) ... skipped 'test needs os.fchown()'
test_fdatasync (test.test_os.TestInvalidFD.test_fdatasync) ... ok
test_fdopen (test.test_os.TestInvalidFD.test_fdopen) ... ok
test_fpathconf (test.test_os.TestInvalidFD.test_fpathconf) ... skipped 'test needs os.fpathconf()'
test_fstat (test.test_os.TestInvalidFD.test_fstat) ... ok
test_fstatvfs (test.test_os.TestInvalidFD.test_fstatvfs) ... ok
test_fsync (test.test_os.TestInvalidFD.test_fsync) ... ok
test_ftruncate (test.test_os.TestInvalidFD.test_ftruncate) ... ok
test_inheritable (test.test_os.TestInvalidFD.test_inheritable) ... ok
test_isatty (test.test_os.TestInvalidFD.test_isatty) ... ok
test_lseek (test.test_os.TestInvalidFD.test_lseek) ... ok
test_read (test.test_os.TestInvalidFD.test_read) ... ok
test_readv (test.test_os.TestInvalidFD.test_readv) ... skipped 'test needs os.readv()'
test_tcgetpgrp (test.test_os.TestInvalidFD.test_tcgetpgrp) ... ok
test_tcsetpgrpt (test.test_os.TestInvalidFD.test_tcsetpgrpt) ... skipped 'test needs os.tcsetpgrp()'
test_ttyname (test.test_os.TestInvalidFD.test_ttyname) ... ok
test_write (test.test_os.TestInvalidFD.test_write) ... ok
test_writev (test.test_os.TestInvalidFD.test_writev) ... skipped 'test needs os.writev()'
test_argument_required (test.test_os.TestPEP519.test_argument_required) ... ok
test_bad_pathlike (test.test_os.TestPEP519.test_bad_pathlike) ... ok
test_fsencode_fsdecode (test.test_os.TestPEP519.test_fsencode_fsdecode) ... ok
test_fspath_set_to_None (test.test_os.TestPEP519.test_fspath_set_to_None) ... ok
test_garbage_in_exception_out (test.test_os.TestPEP519.test_garbage_in_exception_out) ... ok
test_pathlike (test.test_os.TestPEP519.test_pathlike) ... ok
test_pathlike_class_getitem (test.test_os.TestPEP519.test_pathlike_class_getitem) ... ok
test_pathlike_subclass_slots (test.test_os.TestPEP519.test_pathlike_subclass_slots) ... ok
test_pathlike_subclasshook (test.test_os.TestPEP519.test_pathlike_subclasshook) ... ok
test_return_bytes (test.test_os.TestPEP519.test_return_bytes) ... ok
test_return_string (test.test_os.TestPEP519.test_return_string) ... ok
test_argument_required (test.test_os.TestPEP519PurePython.test_argument_required) ... ok
test_bad_pathlike (test.test_os.TestPEP519PurePython.test_bad_pathlike) ... ok
test_fsencode_fsdecode (test.test_os.TestPEP519PurePython.test_fsencode_fsdecode) ... ok
test_fspath_set_to_None (test.test_os.TestPEP519PurePython.test_fspath_set_to_None) ... ok
test_garbage_in_exception_out (test.test_os.TestPEP519PurePython.test_garbage_in_exception_out) ... ok        
test_pathlike (test.test_os.TestPEP519PurePython.test_pathlike) ... ok
test_pathlike_class_getitem (test.test_os.TestPEP519PurePython.test_pathlike_class_getitem) ... ok
test_pathlike_subclass_slots (test.test_os.TestPEP519PurePython.test_pathlike_subclass_slots) ... ok
test_pathlike_subclasshook (test.test_os.TestPEP519PurePython.test_pathlike_subclasshook) ... ok
test_return_bytes (test.test_os.TestPEP519PurePython.test_return_bytes) ... ok
test_return_string (test.test_os.TestPEP519PurePython.test_return_string) ... ok
test_attributes (test.test_os.TestScandir.test_attributes) ... ok
test_attributes_junctions (test.test_os.TestScandir.test_attributes_junctions) ... ok
test_bad_path_type (test.test_os.TestScandir.test_bad_path_type) ... ok
test_broken_symlink (test.test_os.TestScandir.test_broken_symlink) ... skipped 'cannot create symbolic link'  
test_bytes (test.test_os.TestScandir.test_bytes) ... ok
test_bytes_like (test.test_os.TestScandir.test_bytes_like) ... ok
test_close (test.test_os.TestScandir.test_close) ... ok
test_consume_iterator_twice (test.test_os.TestScandir.test_consume_iterator_twice) ... ok
test_context_manager (test.test_os.TestScandir.test_context_manager) ... ok
test_context_manager_close (test.test_os.TestScandir.test_context_manager_close) ... ok
test_context_manager_exception (test.test_os.TestScandir.test_context_manager_exception) ... ok
test_current_directory (test.test_os.TestScandir.test_current_directory) ... ok
test_empty_path (test.test_os.TestScandir.test_empty_path) ... ok
test_fd (test.test_os.TestScandir.test_fd) ... skipped 'fd support for listdir required for this test.'       
test_fspath_protocol (test.test_os.TestScandir.test_fspath_protocol) ... ok
test_fspath_protocol_bytes (test.test_os.TestScandir.test_fspath_protocol_bytes) ... ok
test_removed_dir (test.test_os.TestScandir.test_removed_dir) ... ok
test_removed_file (test.test_os.TestScandir.test_removed_file) ... ok
test_repr (test.test_os.TestScandir.test_repr) ... ok
test_resource_warning (test.test_os.TestScandir.test_resource_warning) ... ok
test_uninstantiable (test.test_os.TestScandir.test_uninstantiable) ... ok
test_unpickable (test.test_os.TestScandir.test_unpickable) ... ok
test_flags (test.test_os.TestSendfile.test_flags) ... skipped 'test needs os.sendfile()'
test_headers (test.test_os.TestSendfile.test_headers) ... skipped 'test needs os.sendfile()'
test_headers_overflow_32bits (test.test_os.TestSendfile.test_headers_overflow_32bits) ... skipped 'test needs 
os.sendfile()'
test_invalid_offset (test.test_os.TestSendfile.test_invalid_offset) ... skipped 'test needs os.sendfile()'    
test_keywords (test.test_os.TestSendfile.test_keywords) ... skipped 'test needs os.sendfile()'
test_offset_overflow (test.test_os.TestSendfile.test_offset_overflow) ... skipped 'test needs os.sendfile()'  
test_send_at_certain_offset (test.test_os.TestSendfile.test_send_at_certain_offset) ... skipped 'test needs os.sendfile()'
test_send_whole_file (test.test_os.TestSendfile.test_send_whole_file) ... skipped 'test needs os.sendfile()'  
test_trailers (test.test_os.TestSendfile.test_trailers) ... skipped 'test needs os.sendfile()'
test_trailers_overflow_32bits (test.test_os.TestSendfile.test_trailers_overflow_32bits) ... skipped 'test needs os.sendfile()'
test_timerfd_TFD_TIMER_ABSTIME (test.test_os.TimerfdTests.test_timerfd_TFD_TIMER_ABSTIME) ... skipped 'requires os.timerfd_create'
test_timerfd_initval (test.test_os.TimerfdTests.test_timerfd_initval) ... skipped 'requires os.timerfd_create'test_timerfd_interval (test.test_os.TimerfdTests.test_timerfd_interval) ... skipped 'requires os.timerfd_create'
test_timerfd_negative (test.test_os.TimerfdTests.test_timerfd_negative) ... skipped 'requires os.timerfd_create'
test_timerfd_non_blocking (test.test_os.TimerfdTests.test_timerfd_non_blocking) ... skipped 'requires os.timerfd_create'
test_timerfd_ns_TFD_TIMER_ABSTIME (test.test_os.TimerfdTests.test_timerfd_ns_TFD_TIMER_ABSTIME) ... skipped 'requires os.timerfd_create'
test_timerfd_ns_initval (test.test_os.TimerfdTests.test_timerfd_ns_initval) ... skipped 'requires os.timerfd_create'
test_timerfd_ns_interval (test.test_os.TimerfdTests.test_timerfd_ns_interval) ... skipped 'requires os.timerfd_create'
test_timerfd_ns_poll (test.test_os.TimerfdTests.test_timerfd_ns_poll) ... skipped 'requires os.timerfd_create'test_timerfd_ns_select (test.test_os.TimerfdTests.test_timerfd_ns_select) ... skipped 'requires os.timerfd_create'
test_timerfd_poll (test.test_os.TimerfdTests.test_timerfd_poll) ... skipped 'requires os.timerfd_create'      
test_timerfd_select (test.test_os.TimerfdTests.test_timerfd_select) ... skipped 'requires os.timerfd_create'  
test_times (test.test_os.TimesTests.test_times) ... ok
test_urandom_failure (test.test_os.URandomFDTests.test_urandom_failure) ... skipped 'test requires the resource module'
test_urandom_fd_closed (test.test_os.URandomFDTests.test_urandom_fd_closed) ... ok
test_urandom_fd_reopened (test.test_os.URandomFDTests.test_urandom_fd_reopened) ... ok
test_urandom_length (test.test_os.URandomTests.test_urandom_length) ... ok
test_urandom_subprocess (test.test_os.URandomTests.test_urandom_subprocess) ... ok
test_urandom_value (test.test_os.URandomTests.test_urandom_value) ... ok
test_issue31577 (test.test_os.UtimeTests.test_issue31577) ... ok
test_large_time (test.test_os.UtimeTests.test_large_time) ... ok
test_utime (test.test_os.UtimeTests.test_utime) ... ok
test_utime_by_indexed (test.test_os.UtimeTests.test_utime_by_indexed) ... ok
test_utime_by_times (test.test_os.UtimeTests.test_utime_by_times) ... ok
test_utime_current (test.test_os.UtimeTests.test_utime_current) ... ok
test_utime_current_old (test.test_os.UtimeTests.test_utime_current_old) ... ok
test_utime_dir_fd (test.test_os.UtimeTests.test_utime_dir_fd) ... skipped 'dir_fd support for utime required for this test.'
test_utime_directory (test.test_os.UtimeTests.test_utime_directory) ... ok
test_utime_fd (test.test_os.UtimeTests.test_utime_fd) ... skipped 'fd support for utime required for this test.'
test_utime_invalid_arguments (test.test_os.UtimeTests.test_utime_invalid_arguments) ... ok
test_utime_nofollow_symlinks (test.test_os.UtimeTests.test_utime_nofollow_symlinks) ... skipped 'follow_symlinks support for utime required for this test.'
test_utime_nonexistent (test.test_os.UtimeTests.test_utime_nonexistent) ... ok
test_file_like_path (test.test_os.WalkTests.test_file_like_path) ... ok
test_walk_above_recursion_limit (test.test_os.WalkTests.test_walk_above_recursion_limit) ... ok
test_walk_bad_dir (test.test_os.WalkTests.test_walk_bad_dir) ... ok
test_walk_bad_dir2 (test.test_os.WalkTests.test_walk_bad_dir2) ... ok
test_walk_bottom_up (test.test_os.WalkTests.test_walk_bottom_up) ... ok
test_walk_many_open_files (test.test_os.WalkTests.test_walk_many_open_files) ... ok
test_walk_named_pipe (test.test_os.WalkTests.test_walk_named_pipe) ... skipped 'requires os.mkfifo()'
test_walk_named_pipe2 (test.test_os.WalkTests.test_walk_named_pipe2) ... skipped 'requires os.mkfifo()'       
test_walk_prune (test.test_os.WalkTests.test_walk_prune) ... ok
test_walk_symlink (test.test_os.WalkTests.test_walk_symlink) ... skipped 'need symlink support'
test_walk_topdown (test.test_os.WalkTests.test_walk_topdown) ... ok
test_chdir (test.test_os.Win32ErrorTests.test_chdir) ... ok
test_chmod (test.test_os.Win32ErrorTests.test_chmod) ... ok
test_mkdir (test.test_os.Win32ErrorTests.test_mkdir) ... ok
test_remove (test.test_os.Win32ErrorTests.test_remove) ... ok
test_rename (test.test_os.Win32ErrorTests.test_rename) ... ok
test_utime (test.test_os.Win32ErrorTests.test_utime) ... ok
test_create_junction (test.test_os.Win32JunctionTests.test_create_junction) ... ok
test_unlink_removes_junction (test.test_os.Win32JunctionTests.test_unlink_removes_junction) ... ok
test_CTRL_BREAK_EVENT (test.test_os.Win32KillTests.test_CTRL_BREAK_EVENT) ... ok
test_CTRL_C_EVENT (test.test_os.Win32KillTests.test_CTRL_C_EVENT) ... skipped "subprocesses aren't inheriting 
Ctrl+C property"
test_kill_int (test.test_os.Win32KillTests.test_kill_int) ... ok
test_kill_sigterm (test.test_os.Win32KillTests.test_kill_sigterm) ... ok
test_listdir_extended_path (test.test_os.Win32ListdirTests.test_listdir_extended_path)
Test when the path starts with '\\?\'. ... ok
test_listdir_no_extended_path (test.test_os.Win32ListdirTests.test_listdir_no_extended_path)
Test when the path is not an "extended" path. ... ok
test_listdrives (test.test_os.Win32ListdriveTests.test_listdrives) ... ok
test_listmounts (test.test_os.Win32ListdriveTests.test_listmounts) ... ok
test_listvolumes (test.test_os.Win32ListdriveTests.test_listvolumes) ... ok
test_getfinalpathname_handles (test.test_os.Win32NtTests.test_getfinalpathname_handles) ... ok
test_stat_inaccessible_file (test.test_os.Win32NtTests.test_stat_inaccessible_file) ... File: @test_6120_tmpæ
stat with access: os.stat_result(st_mode=33206, st_ino=112871465661126816, st_dev=2917237812109254748, st_nlink=1, st_uid=0, st_gid=0, st_size=9, st_atime=1715203810, st_mtime=1715203810, st_ctime=1715203806)
 without access: os.stat_result(st_mode=33206, st_ino=0, st_dev=0, st_nlink=0, st_uid=0, st_gid=0, st_size=9, 
st_atime=1715203810, st_mtime=1715203810, st_ctime=1715203806)
ERROR
test_stat_unlink_race (test.test_os.Win32NtTests.test_stat_unlink_race) ... ok
test_12084 (test.test_os.Win32SymlinkTests.test_12084) ... skipped 'Requires functional symlink implementation'
test_29248 (test.test_os.Win32SymlinkTests.test_29248) ... skipped 'Requires functional symlink implementation'
test_appexeclink (test.test_os.Win32SymlinkTests.test_appexeclink) ... skipped 'Requires functional symlink implementation'
test_buffer_overflow (test.test_os.Win32SymlinkTests.test_buffer_overflow) ... skipped 'Requires functional symlink implementation'
test_directory_link (test.test_os.Win32SymlinkTests.test_directory_link) ... skipped 'Requires functional symlink implementation'
test_file_link (test.test_os.Win32SymlinkTests.test_file_link) ... skipped 'Requires functional symlink implementation'
test_isdir_on_directory_link_to_missing_target (test.test_os.Win32SymlinkTests.test_isdir_on_directory_link_to_missing_target) ... skipped 'Requires functional symlink implementation'
test_remove_directory_link_to_missing_target (test.test_os.Win32SymlinkTests.test_remove_directory_link_to_missing_target) ... skipped 'Requires functional symlink implementation'
test_rmdir_on_directory_link_to_missing_target (test.test_os.Win32SymlinkTests.test_rmdir_on_directory_link_to_missing_target) ... skipped 'Requires functional symlink implementation'

======================================================================
ERROR: test_stat_inaccessible_file (test.test_os.Win32NtTests.test_stat_inaccessible_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\KIRILL-1\CLionProjects\cpython\Lib\test\test_os.py", line 3231, in cleanup
    subprocess.check_output([ICACLS, filename, "/grant", "Everyone:(D)"],
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            stderr=subprocess.STDOUT)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\KIRILL-1\CLionProjects\cpython\Lib\subprocess.py", line 472, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               **kwargs).stdout
               ^^^^^^^^^
  File "C:\Users\KIRILL-1\CLionProjects\cpython\Lib\subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['C:\\Windows\\System32\\icacls.exe', '@test_6120_tmpæ', '/grant', 'Everyone:(D)']' returned non-zero exit status 1332.

----------------------------------------------------------------------
Ran 362 tests in 11.095s

FAILED (errors=1, skipped=142)
test test_os failed
test_os failed (1 error)

== Tests result: FAILURE ==

1 test failed:
    test_os

Total duration: 11.6 sec
Total tests: run=362 skipped=142
Total test files: run=1/1 failed=1
Result: FAILURE

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

@Eclips4 Eclips4 added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir OS-windows labels May 8, 2024
@zware
Copy link
Member

zware commented May 9, 2024

This is the same underlying issue as #118773, isn't it?

@zware zware added the pending The issue will be closed if no feedback is provided label May 9, 2024
@eryksun
Copy link
Contributor

eryksun commented May 9, 2024

Win32NtTests.test_stat_inaccessible_file() incorrectly depends on the localized name of the well-known group "Everyone". It would need to use the SDDL alias *WD.

Actually the test should be implemented differently by denying synchronize (S) access to users (*BU), like StatAttributeTests.test_access_denied() (which is a redundant test now). However, this can only test the slow path of os.stat(), which depends on opening the file with SYNCRHONIZE | FILE_READ_ATTRIBUTES access. That's the minimum access that can be requested via CreateFileW(). If that minimum level of access is denied, the slow path of os.stat() falls back on the parent directory entry from FindFirstFileW().

The fast path of GetFileInformationByName() or GetFileAttributesW() doesn't need the right to synchronize on the file. It only needs read-attributes (RA) access, but there's no meaningful way to deny that access for this test. If read-attributes access isn't allowed explicitly for a file, or if read-attributes access is explicitly denied, then it's still implicitly allowed as long as read-data access (i.e. list-directory access) is allowed for the parent directory.

@eryksun eryksun removed the pending The issue will be closed if no feedback is provided label May 9, 2024
@Eclips4
Copy link
Member Author

Eclips4 commented May 9, 2024

This is the same underlying issue as #118773, isn't it?

I tried #118800 before submitting this issue, and that PR did not resolve it, so it seems like a different problem to me.

@zooba
Copy link
Member

zooba commented May 9, 2024

Same root cause (localised account names), but different code.

@zooba
Copy link
Member

zooba commented May 9, 2024

The fast path of GetFileInformationByName() or GetFileAttributesW() doesn't need the right to synchronize on the file. It only needs read-attributes (RA) access, but there's no meaningful way to deny that access for this test. If read-attributes access isn't allowed explicitly for a file, or if read-attributes access is explicitly denied, then it's still implicitly allowed as long as read-data access (i.e. list-directory access) is allowed for the parent directory.

Yeah, this is known - it's why the test checks for either 0 or st_ino/dev, because if we take the faster path we'll get them. So eventually the test becomes redundant, but until then it helps verify that we aren't returning garbage in certain fields (which was the bug that prompted it).

It would need to use the SDDL alias *WD.

This seems to work fine, PR incoming.

zooba added a commit to zooba/cpython that referenced this issue May 9, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 9, 2024
…H-118831)

(cherry picked from commit 82acc5f)

Co-authored-by: Steve Dower <steve.dower@python.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 9, 2024
…H-118831)

(cherry picked from commit 82acc5f)

Co-authored-by: Steve Dower <steve.dower@python.org>
@zooba zooba closed this as completed May 9, 2024
zooba added a commit that referenced this issue May 9, 2024
(cherry picked from commit 82acc5f)

Co-authored-by: Steve Dower <steve.dower@python.org>
zooba added a commit that referenced this issue May 9, 2024
(cherry picked from commit 82acc5f)

Co-authored-by: Steve Dower <steve.dower@python.org>
@eryksun
Copy link
Contributor

eryksun commented May 9, 2024

Yeah, this is known - it's why the test checks for either 0 or st_ino/dev, because if we take the faster path we'll get them. So eventually the test becomes redundant, but until then it helps verify that we aren't returning garbage in certain fields (which was the bug that prompted it).

Sorry, I git blamed to find the PR that added the test, and somehow I mixed up browser tabs and ended up looking at the original code instead of the latest code. I see that you changed it to use checks such as self.assertIn(stat2.st_dev, (0, stat1.st_dev)) instead of self.assertEqual(0, stat2.st_dev).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants