+
    BiQ                       ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt  ^ RIt ^ RIt]P6                  P9                  ]P:                  ! 4       ]P<                  R,           4      t]P@                  ! ]
PB                  R$8  ;'       d&    ]PD                  ;'       g    ]PF                  '       * R	4      t$R
 t%]P@                  ! ]%! 4       R4      t& ! R R]PN                  4      t( ! R R]PN                  4      t) ! R R]PN                  4      t* ! R R4      t+]P@                  ! ],! ]R4      R4      ]PZ                  ! 4        ! R R]PN                  ]+4      4       4       t.]P@                  ! ],! ]R4      R4      ]PZ                  ! 4        ! R R]PN                  ]+4      4       4       t/]P@                  ! ]
P                  R8H  R4       ! R R]PN                  4      4       t0 ! R  R!]PN                  4      t1R" t2]3R#8X  d   ]Ph                  ! 4        R# R#   ] d	    ^ RIt ELi ; i  ] d    Rt ELi ; i)%    )support)is_apple)	os_helper)warnings_helperassert_python_okN)contextmanagerz-dummy-symlinkz(test is only meaningful on 32-bit buildsc                      \        \        R 4      '       g   R#  \        P                  ! ^ 4       R#   \         d1   p T P                  \        P
                  8X  d    Rp ? R#  Rp ? R# Rp ? ii ; i)sched_getschedulerFNT)hasattrposixr   OSErrorerrnoENOSYS)es    &/usr/lib/python3.14/test/test_posix.py_supports_schedr   +   sX    5.//  #   77ell" #s   2 A-A((A-zrequires POSIX scheduler APIc                     a  ] tR t^8t o R tR t]P                  ! ]! ]	R4      R4      R 4       t
]P                  ! ]! ]	R4      R4      R 4       t]P                  ! ]! ]	R	4      R
4      R 4       t]P                  ! ]! ]	R	4      R
4      R 4       t]P                  ! ]! ]	R4      R4      R 4       t]P                  ! ]! ]	R4      R4      R 4       t]P                  ! ]! ]	R4      R4      ]P                  ! ]! ]R4      R4      R 4       4       t]P                  ! ]! ]	R4      R4      R 4       t]P                  ! ]! ]	R4      R4      R 4       t]P                  ! ]! ]	R4      R4      R 4       t]P                  ! ]! ]	R4      R 4      R! 4       t]P                  ! ]! ]R"R#4      ]P0                  9   R$4      ]P4                  ! 4       R% 4       4       t]P                  ! ]! ]	R&4      R'4      ]P4                  ! 4       R( 4       4       t]P4                  ! 4       R) 4       t]P                  ! ]! ]	R*4      R+4      R, 4       t]P                  ! ]! ]	R-4      R.4      R/ 4       t]P                  ! ]! ]	R04      R14      R2 4       t ]P                  ! ]! ]	R04      R14      ]P                  ! ]! ]	R34      R44      R5 4       4       t!]P                  ! ]! ]	R04      R14      ]"R6 4       4       t#]P                  ! ]! ]	R74      R84      R9 4       t$]P                  ! ]! ]	R:4      R;4      R< 4       t%]P                  ! ]! ]	R:4      R;4      ]P                  ! ]! ]	R=4      R>4      R? 4       4       t&]P                  ! ]! ]	R:4      R;4      ]"R@ 4       4       t']P                  ! ]! ]	RA4      RB4      RC 4       t(]P                  ! ]! ]	RA4      RB4      RD 4       t)]P                  ! ]! ]	RE4      RF4      RG 4       t*]P                  ! ]! ]	RE4      RF4      RH 4       t+]P                  ! ]PX                  ]P0                  9   RI4      RJ 4       t-]P                  ! ]PX                  ]P\                  9   RK4      RL 4       t/]P                  ! ]! ]	RM4      RN4      RO 4       t0]P                  ! ]! ]	RM4      RN4      ]"RP 4       4       t1]P                  ! ]! ]	RQ4      RR4      RS 4       t2]P                  ! ]! ]	RQ4      RR4      ]"RT 4       4       t3]P                  ! ]! ]	RU4      RV4      ]Ph                  ! ]Pj                  RW4      RX 4       4       t6]P                  ! ]! ]	RY4      RZ4      R[ 4       t7]P                  ! ]! ]	R\4      R]4      R^ 4       t8]P                  ! ]! ]	R_4      R`4      ]Ph                  ! ]Pj                  Ra4      Rb 4       4       t9]P                  ! ]! ]Rc4      Rd4      ]Pt                  ! ^^^4      ]Pv                  ! 4       Re 4       4       4       t<]P                  ! ]! ]	Rf4      Rg4      Rh 4       t=]P                  ! ]! ]	Ri4      Rj4      Rk 4       t>]P                  ! ]! ]	Rl4      Rm4      Rn 4       t?Ro t@]P                  ! ]! ]	Rp4      Rq4      Rr 4       tA]P                  ! ]! ]	Rs4      ;'       d
    ]! ]BRt4      Ru4      Rv 4       tC]P                  ! ]! ]	Rw4      Rx4      Ry 4       tDRz tE]P                  ! ]! ]R{4      R|4      ]Ph                  ! ]P                  R}4      R~ 4       4       tG]HP                  ]P                  ! ]! ]	R4      R4      ]Ph                  ! ]P                  R}4      R 4       4       4       tJ]HP                  ]P                  ! ]! ]	R4      R4      R 4       4       tK]P                  ! ]! ]	R4      R4      R 4       tLR tMR tNR tOR tP]P                  ! ]	P                  ]P0                  9   R4      R 4       tR]P                  ! ]! ]	R4      R4      R 4       tS]P                  ! ]! ]	R4      R4      R 4       tT]P                  ! ]! ]	R4      R4      R 4       tU]P                  ! ]! ]	R4      R4      R 4       tV]P                  ! ]! ]R4      R4      ]Pt                  ! ^^^4      R 4       4       tW]P                  ]P                  ! ]! ]R4      R4      ]Pt                  ! ^^^4      R 4       4       4       tY]P                  ! ]! ]	R4      R4      R 4       tZR t[]HP                  R 4       t\R t]]HP                  R 4       t^]HP                  R 4       t_]P                  ! ]! ]	R4      R4      R 4       t`]P                  ! ]! ]	R4      R4      R 4       taR tbR tc]HP                  R 4       te]HP                  R 4       tf]P                  ! ]! ]	R4      R4      ]HP                  R 4       4       tg]P                  ! ]! ]	R4      R4      ]HP                  R 4       4       thR ti]P                  ! ]! ]	R4      R4      R 4       tj]P                  ! ]! ]	R4      R4      R 4       tk]P                  ! ]! ]	R4      R4      R 4       tlR tmR tn]P                  ! ]! ]	R4      R4      R 4       to]P                  ! ]! ]	R4      R4      ]P                  ! ]! ]R4      R4      ]P                  ! ]! ]R4      R4      R 4       4       4       tp]P                  ! ]! ]R4      R4      ]P                  ! ]! ]R4      R4      ]Pv                  ! 4       R 4       4       4       tq]P                  ! ]! ]rR4      R4      ]P                  ! ]! ]R4      R4      R 4       4       ts]P                  ! ]! ]	R4      R4      tt]P                  ! ]! ]	R4      R4      tu]tR 4       tv]t]P                  ! ]! ]	R4      R4      R 4       4       tw]xR 4       ty]xR 4       tz]P                  ! ]! ]	R4      R4      R 4       t{]uR 4       t|]uR 4       t}]Ph                  ! ]Pj                  R4      ]P                  ! ]P                  R8H  R4      R 4       4       t]P                  ! ]! ]R4      R4      R 4       tR tR tR t]P                  ! ]! ]R4      R4      R 4       t]HEP
                  ]HP                  R 4       4       tRtV tR## )PosixTesterc                `   V P                  \        P                  \        P                  4       \	        \        P                  R 4      ;_uu_ 4         RRR4       V P                  \        P                  ! 4       4       \        P                  ! RR\        4       R#   + '       g   i     LR; i)wbNignorez.* potential security risk .*)
addCleanupr   unlinkTESTFNopenenterContextr   check_warningswarningsfilterwarningsRuntimeWarningselfs   &r   setUpPosixTester.setUp:   sm    	(()*:*:;)""D)) */88:;*I .	0 *)s   BB-	c                    . ROpV FZ  p\        \        VR4      pVf   K  V P                  V4      ;_uu_ 4        V! 4        V P                  \        V^4       RRR4       K\  	  R#   + '       g   i     Kq  ; i)ctermidN)r'   getcwdgetcwdbunametimes
getloadavggetegidgeteuidgetgid	getgroupsgetpidgetpgrpgetppidgetuidsync)getattrr   subTestassertRaises	TypeError)r#   NO_ARG_FUNCTIONSname
posix_funcs   &   r   testNoArgFunctionsPosixTester.testNoArgFunctionsC   sd     %D d3J%\\$''L%%iQ? (' % (''s   A''A8	getresuidztest needs posix.getresuid()c                    \         P                  ! 4       pV P                  \        V4      ^4       V F  pV P	                  V^ 4       K  	  R#    N)r   r?   assertEquallenassertGreaterEqual)r#   user_idsvals   &  r   test_getresuidPosixTester.test_getresuidS   s>     ??$X*C##C+     	getresgidztest needs posix.getresgid()c                    \         P                  ! 4       pV P                  \        V4      ^4       V F  pV P	                  V^ 4       K  	  R# rA   )r   rK   rC   rD   rE   )r#   	group_idsrG   s   &  r   test_getresgidPosixTester.test_getresgid[   s>     OO%	Y+C##C+ rJ   	setresuidztest needs posix.setresuid()c                    \         P                  ! 4       pV P                  \         P                  ! V!  4       V P                  \         P                  ! RRR4      4       R#    N)r   r?   assertIsNonerP   )r#   current_user_idss   & r   test_setresuidPosixTester.test_setresuidc   sD     !??,%//+;<=%//"b"56rJ   c                    \         P                  ! 4       p^ V9  d=   V^ ,          ^,           RR3pV P                  ! \        \         P                  .VO5!   R# R# r   NrT   )r   r?   r8   r   rP   )r#   rV   new_user_idss   &  r   test_setresuid_exception$PosixTester.test_setresuid_exceptionk   sN     !??,$$,Q/12r:LguFF %rJ   	setresgidztest needs posix.setresgid()c                    \         P                  ! 4       pV P                  \         P                  ! V!  4       V P                  \         P                  ! RRR4      4       R# rR   )r   rK   rU   r^   )r#   current_group_idss   & r   test_setresgidPosixTester.test_setresgidt   sD     "OO-%//+<=>%//"b"56rJ   c                    \         P                  ! 4       p^ V9  d=   V^ ,          ^,           RR3pV P                  ! \        \         P                  .VO5!   R# R# rZ   )r   rK   r8   r   r^   )r#   r`   new_group_idss   &  r   test_setresgid_exception$PosixTester.test_setresgid_exception|   sN     "OO-%%.q1!3R<MguGG &rJ   
initgroupsztest needs os.initgroups()getpwuidztest needs pwd.getpwuid()c                   V P                  \        \        P                  4       V P                  \        \        P                  R 4       V P                  \        \        P                  ^R4       V P                  \        \        P                  R^\	        4       4       \
        P                  ! 4       ^ 8w  d`    \        P                  ! \        P                  ! 4       4      P                  p \        P                  ! T^4       T P                  R4       R # R #   \         d    \        P                  ! R4      hi ; i  \         d6   pT P                  TP                   \         P"                  4        R p?R # R p?ii ; i)Nfoozneed a pwd entryz+Expected OSError to be raised by initgroups)r8   r9   r   rg   objectosr4   pwdrh   pw_nameKeyErrorunittestSkipTestfailr   rC   r   EPERM)r#   r;   r   s   &  r   test_initgroupsPosixTester.test_initgroups   s    	)U%5%56)U%5%5t<)U%5%5q%@)U%5%5uaJ 99;!<||ELLN3;;I  r* 		GH   <''(:;;<
  7  %++667s$   :3D .D? "D<?E?
*E::E?statvfsztest needs posix.statvfs()c                l    V P                  \        P                  ! \        P                  4      4       R # N)
assertTruer   rv   rl   curdirr"   s   &r   test_statvfsPosixTester.test_statvfs   s     	bii01rJ   fstatvfsztest needs posix.fstatvfs()c                P   \        \        P                  4      p V P                  \        P
                  ! VP                  4       4      4       V P                  \        P                  ! VP                  4       4      4       VP                  4        R #   TP                  4        i ; irx   )	r   r   r   ry   r   r}   filenorv   closer#   fps   & r   test_fstatvfsPosixTester.test_fstatvfs   sb     )""#	OOENN299;78OOEMM"))+67HHJBHHJs   A&B B%	ftruncateztest needs posix.ftruncate()c                   \        \        P                  R 4      p VP                  R4       VP	                  4        \
        P                  ! VP                  4       ^ 4       VP                  4        R#   TP                  4        i ; i)w+testN)	r   r   r   writeflushr   r   r   r   r   s   & r   test_ftruncatePosixTester.test_ftruncate   sW     )""D)	HHVHHJOOBIIK+HHJBHHJs   AA4 4Btruncateztest needs posix.truncate()c                   \        \        P                  R 4      ;_uu_ 4       pVP                  R4       VP	                  4        RRR4       \
        P                  ! \        P                  ^ 4       R#   + '       g   i     L7; i)wr   N)r   r   r   r   r   r   r   r   s   & r   test_truncatePosixTester.test_truncate   sP    )""C((BHHVHHJ ) 	y''+ )(s   "A44B	execveNz/test needs execve() to support the fd parameterc                8   \         P                  ! \        P                  \         P                  4      p \         P
                  ! 4       pV^ 8X  d   \         P                  ! \         P                  P                  \        P                  4      ^ ,          4       \        P                  ! V\        P                  RR.\         P                  4       M\        P                  ! V^ R7       \         P                  ! V4       R#   \         P                  ! T4       i ; i)r   -cpassexitcodeN)rl   r   sys
executableO_RDONLYforkchdirpathsplitr   r   environr   wait_processr   )r#   r   pids   &  r   test_fexecvePosixTester.test_fexecve   s     WWS^^R[[1	'')Caxs~~6q9:R#..$!?L$$S15HHRLBHHRLs   B4D Dwaitidztest needs posix.waitid()c                   \         P                  ! 4       pV^ 8X  d   \         P                  ! \         P                  P	                  \
        P                  4      ^ ,          4       \        P                  ! \
        P                  \
        P                  RR.\         P                  4       R# \        P                  ! \        P                  V\        P                  4      pV P                  WP                  4       R# )r   r   r   N)rl   r   r   r   r   r   r   r   r   r   r   P_PIDWEXITEDrC   si_pid)r#   r   ress   &  r   test_waitidPosixTester.test_waitid   s     ggi!8HHRWW]]3>>2156LL#..$)GT,,u{{C?CS**-rJ   c                   V P                  \        R R7      ;_uu_ 4        \        P                  ! R 4       RRR4       V P                  \        RR7      ;_uu_ 4        \        P                  ! ^R7       RRR4       V P                  \        RR7      ;_uu_ 4        \        P                  ! RR7       RRR4       V P                  \        RR7      ;_uu_ 4        \        P                  ! RR	7       RRR4       V P                  \        R
R7      ;_uu_ 4        \        P                  ! RR7       RRR4       V P                  \        R
R7      ;_uu_ 4        \        P                  ! RR7       RRR4       V P                  \        R
R7      ;_uu_ 4        \        P                  ! RR	7       RRR4       V P                  \        RR7      ;_uu_ 4        \        P                  ! RR R7       RRR4       V P                  \        RR7      ;_uu_ 4        \        P                  ! 4        RRR4       V P                  \        RR7      ;_uu_ 4        \        P                  ! R RR7       RRR4       Rp\	        RV4       R#   + '       g   i     ELZ; i  + '       g   i     EL/; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELX; i  + '       g   i     EL+; i  + '       g   i     EL; i  + '       g   i     L; i)zPositional args not allowed)msgc                      R # rx    r   rJ   r   <lambda>3PosixTester.test_register_at_fork.<locals>.<lambda>   s    rJ   NzArgs must be callable)beforethree)after_in_childs   Five)after_in_parentzArgs must not be NonezInvalid arg was allowedc                      ^# )rB   r   r   rJ   r   r   r      s    QrJ   )r   r   z!At least one argument is requiredc                      R # rx   r   r   rJ   r   r   r      s    trJ    )r   r   a  if 1:
            import os

            r, w = os.pipe()
            fin_r, fin_w = os.pipe()

            os.register_at_fork(before=lambda: os.write(w, b'A'))
            os.register_at_fork(after_in_parent=lambda: os.write(w, b'C'))
            os.register_at_fork(after_in_child=lambda: os.write(w, b'E'))
            os.register_at_fork(before=lambda: os.write(w, b'B'),
                                after_in_parent=lambda: os.write(w, b'D'),
                                after_in_child=lambda: os.write(w, b'F'))

            pid = os.fork()
            if pid == 0:
                # At this point, after-forkers have already been executed
                os.close(w)
                # Wait for parent to tell us to exit
                os.read(fin_r, 1)
                os._exit(0)
            else:
                try:
                    os.close(w)
                    with open(r, "rb") as f:
                        data = f.read()
                        assert len(data) == 6, data
                        # Check before-fork callbacks
                        assert data[:2] == b'BA', data
                        # Check after-fork callbacks
                        assert sorted(data[2:]) == list(b'CDEF'), data
                        assert data.index(b'C') < data.index(b'D'), data
                        assert data.index(b'E') < data.index(b'F'), data
                finally:
                    os.write(fin_w, b'!')
            r   )r8   r9   rl   register_at_forkr   r#   codes   & r   test_register_at_fork!PosixTester.test_register_at_fork   s5   y.KLL- My.EFFq) Gy.EFFw7 Gy.EFF8 Gy.EFFt, Gy.EFFt4 Gy.EFF5 Gy.GHHtYG I y.QRR! S y.GHH|BG I
"F 	t$y MLLFFFFFFFFFFFFFFFFFFHHH SRR IHsw   J	JJ1KKK-LLL)L=	J	J.	1K	K	K*	-K>	L	L&	)L:	=M	lockfztest needs posix.lockf()c                   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \         P                  ! VR 4       \         P                  ! V^ \         P                  4       \        P                  ! V\        P                  ^4       \        P                  ! V\        P                  ^4       \         P                  ! V4       R#   \         P                  ! T4       i ; i)   testN)rl   r   r   r   O_WRONLYO_CREATr   lseekSEEK_SETr   r   F_LOCKF_ULOCKr   r#   fds   & r   
test_lockfPosixTester.test_lockf  s    WWY%%r{{RZZ'?@	HHR!HHRBKK(KKELL!,KKEMM1-HHRLBHHRLs   
B	C+ +Dpreadztest needs posix.pread()c                   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \         P                  ! VR 4       \         P                  ! V^ \         P                  4       V P                  R\        P                  ! V^^4      4       V P                  R\        P                  ! V^4      4       \         P                  ! V4       R#   \         P                  ! T4       i ; i)r   s   ess   teN)rl   r   r   r   O_RDWRr   r   r   r   rC   r   r   readr   r   s   & r   
test_preadPosixTester.test_pread'  s    WWY%%ryy2::'=>	HHR!HHRBKK(UEKKAq$9:UEJJr1$56HHRLBHHRLs   
BC. .Dpreadvztest needs posix.preadv()c                   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \         P                  ! VR 4       R Uu. uF  p\        V4      NK  	  ppV P                  \        P                  ! W^4      ^
4       V P                  . RO\        V4      4       \         P                  ! V4       R# u upi   \         P                  ! T4       i ; i)   test1tt2t3t5t6t6t8N   rB      s   t1tt2s   t3ts   5t)rl   r   r   r   r   r   r   	bytearrayrC   r   r   listr   )r#   r   ibufs   &   r   test_preadvPosixTester.test_preadv3  s    WWY%%ryy2::'=>	HHR./)23A9Q<C3U\\"15r:6S	BHHRL	 4 HHRLs   
C %C9AC C C4	RWF_HIPRIztest needs posix.RWF_HIPRIc                   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \         P                  ! VR 4       R Uu. uF  p\        V4      NK  	  ppV P                  \        P                  ! W^\         P                  4      ^
4       V P                  . RO\        V4      4       \         P*                  ! T4       R# u upi   \         d    T P                  R4        L;\         dL   pTP                   \         P"                  \         P$                  09   d   \&        P(                  ! R4      hh Rp?ii ; i  \         P*                  ! T4       i ; i)r   zpreadv2 not availablez0RWF_HIPRI is not supported by the current systemNr   r   )rl   r   r   r   r   r   r   r   rC   r   r   r   r   NotImplementedErrorskipTestr   r   EINVALENOTSUPrp   rq   r   )r#   r   r   r   insts   &    r   test_preadv_flagsPosixTester.test_preadv_flags>  s     WWY%%ryy2::'=>	HHR./)23A9Q<C3U\\"1bllCRH6S	B HHRL 4 # 	3MM12 	 zzellEMM::''(Z[[	 HHRLsJ   
C+ %C&9AC+ &C+ +EE! 	EEAEEE! !E9c                z   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \        R4      .R,          pV P                  \        4      ;_uu_ 4       p\         P                  ! W^ 4       RRR4       V P                  XP                  P                  \        P                  4       V P                  \        V^ ,          4      RR,          4       \         P                  ! V4       R#   + '       g   i     L; i  \         P                  ! T4       i ; ir   N          )rl   r   r   r   r   r   r   r8   r   r   rC   	exceptionr   r   bytesr   r#   r   r   cms   &   r   test_preadv_overflow_32bits'PosixTester.test_preadv_overflow_32bitsT  s     WWY%%ryy2::'=>	U#$u,C""7++r		"1% ,R\\//>U3q6]E5L9HHRL ,+
 HHRLs%   
0D" :DA%D" D	D" "D:pwriteztest needs posix.pwrite()c                   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \         P                  ! VR 4       \         P                  ! V^ \         P                  4       \        P                  ! VR^4       V P                  R\        P                  ! V^4      4       \         P                  ! V4       R#   \         P                  ! T4       i ; i)r      xxs   txxtN)rl   r   r   r   r   r   r   r   r   r   r   rC   r   r   r   s   & r   test_pwritePosixTester.test_pwritea  s    WWY%%ryy2::'=>	HHR!HHRBKK(LLUA&WejjQ&78HHRLBHHRLs   
A<C C6pwritevztest needs posix.pwritev()c                f   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \         P                  ! VR 4       \         P                  ! V^ \         P                  4       \         P                  ! V. RO^4      pV P                  V^
4       \         P                  ! V^ \         P                  4       V P                  R\        P                  ! V^d4      4       \         P                  ! V4       R#   \         P                  ! T4       i ; i)r   s   xxtest1tt2t3N   test1s   tt2s   t3)rl   r   r   r   r   r   r   r   r   r   rC   r   r   r   r#   r   ns   &  r   test_pwritevPosixTester.test_pwritevl  s    WWY%%ryy2::'=>		HHRHHRBKK(

28!<AQ#HHRBKK(_ejjS.ABHHRLBHHRLs   
B6D D0zos.RWF_SYNCztest needs os.RWF_SYNCc                   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \         P                  ! VR 4       \         P                  ! V^ \         P                  4       \         P                  ! V. RO^\         P                  4      pV P                  V^
4       \         P                  ! V^ \         P                  4       V P                  R\        P                  ! V^d4      4       \         P                  ! V4       R#   \         P                  ! T4       i ; i)r   s
   xxtest1tt2Nr   )rl   r   r   r   r   r   r   r   r   r   RWF_SYNCrC   r   r   r   r   s   &  r   test_pwritev_flagsPosixTester.test_pwritev_flagsz  s     WWY%%ryy2::'=>		HHRHHRBKK(

28!R[[IAQ#HHRBKK(]EJJr3,?@HHRLBHHRLs   
CD' 'D?c                "   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p V P                  \        4      ;_uu_ 4       p\         P                  ! VR R,          .R,          ^ 4       RRR4       V P                  XP                  P                  \        P                  4       \         P                  ! V4       R#   + '       g   i     L\; i  \         P                  ! T4       i ; i   xNr   r   )rl   r   r   r   r   r   r8   r   r   rC   r   r   r   r   r#   r   r   s   &  r   test_pwritev_overflow_32bits(PosixTester.test_pwritev_overflow_32bits  s     WWY%%ryy2::'=>	""7++r

2u~5q9 ,R\\//>HHRL	 ,+ HHRLs$   
C6 '(C#<C6 #C3	.C6 6Dposix_fallocatez"test needs posix.posix_fallocate()c                   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \        P                  ! V^ ^
4        \         P"                  ! T4       R#   \         d   pTP                  \        P                  8X  d<   \        P                  P                  R4      '       d   \        P                  ! R4      hTP                  \        P                   8X  d<   \        P                  P                  R4      '       d   \        P                  ! R4      hh Rp?ii ; i  \         P"                  ! T4       i ; i)r   z test may fail on ZFS filesystemsnetbsdz test may fail on FFS filesystemsN)sunosfreebsdopenbsdgnukfreebsd)rl   r   r   r   r   r   r   r	  r   r   r   r   platform
startswithrp   rq   
EOPNOTSUPPr   )r#   r   r   s   &  r   test_posix_fallocate PosixTester.test_posix_fallocate  s     WWY%%r{{RZZ'?@	!!"a, HHRL  	
 zzU\\)cll.E.E>/@ /@''(JKKu///CLL4K4KH4U4U''(JKK	 HHRLs+   
A; ;E BD;$D;;E  E Ec                     \         P                  ! R^ ^
4       R#   \         d,   pTP                  \        P                  8w  d   h  Rp?R# Rp?ii ; i*   Ni)r   r	  r   r   EBADFr#   r   s   & r   test_posix_fallocate_errno&PosixTester.test_posix_fallocate_errno  sA    	!!#q"- 	zzU[[( )	s    A AAposix_fadvisez test needs posix.posix_fadvise()c                   \         P                  ! \        P                  \         P                  4      p \
        P                  ! V^ ^ \
        P                  4       \         P                  ! V4       R#   \         P                  ! T4       i ; ir   N)	rl   r   r   r   r   r   r  POSIX_FADV_WILLNEEDr   r   s   & r   test_posix_fadvisePosixTester.test_posix_fadvise  sT     WWY%%r{{3	Aq%*C*CDHHRLBHHRLs   'A4 4Bc                     \         P                  ! R^ ^ \         P                  4       R#   \         d,   pTP                  \        P
                  8w  d   h  Rp?R# Rp?ii ; ir  )r   r  r  r   r   r  r  s   & r   test_posix_fadvise_errno$PosixTester.test_posix_fadvise_errno  sI    	Q5+D+DE 	zzU[[( )	s   '+ A! AA!z!test needs fd support in os.utimec           
        \         P                   ! 4       p\        P                  ! \        P                  \        P
                  4      p \        P                  ! V4       \        P                  ! VR 4       V P                  \        \        P                  VR4       V P                  \        \        P                  W!R 34       V P                  \        \        P                  VR V34       \        P                  ! V\        V4      \        V4      34       \        P                  ! W!V34       V P                  \        \        P                  W!V3W3R7       V P                  \        \        P                  W!^ 3RR7       V P                  \        \        P                  VRV^ 3R7       \        P                  ! V\        V4      \        V\        V4      ,
          R,          4      34       \        P                  ! V\        V4      \        V\        V4      ,
          R,          4      3R7       \        P                  ! V4       R #   \        P                  ! T4       i ; i)N)ns    eANN)timerl   r   r   r   r   r   utimer8   r9   int
ValueErrorr   )r#   nowr   s   &  r   test_utime_with_fdPosixTester.test_utime_with_fd  s   iikWWY%%r{{3	KKOKKD!ib,Gib+Fib4+FKKSXs3x01KK#J'j%++r:3*Uj%++r8Uj%++r<SRSHUKKSXsC#c(Nc+A'BCDKKC#sSX~.D*EFG HHRLBHHRLs   
G'I	 	I!z.test needs follow_symlinks support in os.utimec                   \         P                   ! 4       p\        P                  ! \        P                  R RR7       V P                  \        \        P                  \        P                  RRR7       V P                  \        \        P                  \        P                  VR 3RR7       V P                  \        \        P                  \        P                  R V3RR7       \        P                  ! \        P                  \        V4      \        V4      3RR7       \        P                  ! \        P                  W3RR7       \        P                  ! \        P                  RR7       R # )NFfollow_symlinksr(  r)  r   r*  r   r   r8   r9   r+  r#   r-  s   & r   test_utime_nofollow_symlinks(PosixTester.test_utime_nofollow_symlinks  s    iikI$$dEB)U[[)2B2B& 	 	?)U[[)2B2B+u 	 	>)U[[)2B2B+u 	 	>I$$s3xS&:$)	+I$$sj%HI$$e<rJ   writevztest needs posix.writev()c                \   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \         P                  ! VR4      pV P                  V^
4       \         P                  ! V^ \         P                  4       V P                  R\        P                  ! V^
4      4        \        P                  ! V. 4      pV P                  V^ 4       \         P                  ! V4       R#   \         d     L%i ; i  \         P                  ! T4       i ; i)r   
   test1tt2t3Nr   )rl   r   r   r   r   r   r7  rC   r   r   r   r   r   r   )r#   r   r   sizes   &   r   test_writevPosixTester.test_writev  s    WWY%%ryy2::'=>			"78AQ#HHRBKK(]EJJr2,>?*||B+   q)HHRL    HHRLs1   
A6D D D DD DD D+c                    \         P                  ! \        P                  \         P                  \         P
                  ,          4      p V P                  \        4      ;_uu_ 4       p\         P                  ! VR R,          .R,          4       RRR4       V P                  XP                  P                  \        P                  4       \         P                  ! V4       R#   + '       g   i     L\; i  \         P                  ! T4       i ; ir  )rl   r   r   r   r   r   r8   r   r7  rC   r   r   r   r   r  s   &  r   test_writev_overflow_32bits'PosixTester.test_writev_overflow_32bits  s     WWY%%ryy2::'=>	""7++r		"te|nu45 ,R\\//>HHRL	 ,+ HHRLs$   
C5 ''C"<C5 "C2	-C5 5Dreadvztest needs posix.readv()c           	        \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \         P                  ! VR 4       \         P                  ! V^ \         P                  4       R Uu. uF  p\        V4      NK  	  ppV P                  \        P                  ! W4      ^
4       T P                  . ROV Uu. uF  p\        V4      NK  	  up4        \        P                  ! V. 4      pV P                  V^ 4       \         P                  ! V4       R# u upi u upi   \         d     L/i ; i  \         P                  ! T4       i ; i)r9  Nr   r   )rl   r   r   r   r   r   r   r   r   r   rC   r   r@  r   r   r   )r#   r   r   r   r:  s   &    r   
test_readvPosixTester.test_readv
  s    WWY%%ryy2::'=>	HHR'HHRBKK()23A9Q<C3U[[126638O3aq38OP*{{2r*   q)HHRL 48O
    HHRLsO   
AE D6:E D;
-E 5E  E 6
E  EE EE E)c                x   \         P                  ! \        P                  \         P                  \         P
                  ,          4      p \        R4      .R,          pV P                  \        4      ;_uu_ 4       p\         P                  ! W4       RRR4       V P                  XP                  P                  \        P                  4       V P                  \        V^ ,          4      RR,          4       \         P                  ! V4       R#   + '       g   i     L; i  \         P                  ! T4       i ; ir   )rl   r   r   r   r   r   r   r8   r   r@  rC   r   r   r   r   r   r   s   &   r   test_readv_overflow_32bits&PosixTester.test_readv_overflow_32bits   s     WWY%%ryy2::'=>	U#$u,C""7++r! ,R\\//>U3q6]E5L9HHRL ,+
 HHRLs%   
0D! :DA%D! D	D! !D9dupztest needs posix.dup()zWASI does not have dup()c                $   \        \        P                  4      p \        P                  ! VP                  4       4      pV P                  V\        4       \        P                  ! V4       VP                  4        R #   TP                  4        i ; irx   )
r   r   r   r   rG  r   assertIsInstancer+  rl   r   )r#   r   r   s   &  r   test_dupPosixTester.test_dup-  s[     )""#	299;'B!!"c*HHRLHHJBHHJs   AA= =Bconfstrztest needs posix.confstr()c                   V P                  \        R 4      ;_uu_ 4        \        P                  ! R4       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! R4       RRR4       \        P                  ! R4      pV P                  \        V4      ^ 4       V P                  \        P                  ! \        P                  R,          4      V4       R#   + '       g   i     L; i  + '       g   i     L; i)unrecognized configuration name
CS_garbageN/configuration names must be strings or integersGz?CS_PATH)	assertRaisesRegexr,  r   rL  r9   assertGreaterrD   rC   confstr_names)r#   r   s   & r   test_confstrPosixTester.test_confstr9  s     ##9
 
 MM,'

 ##H
 
 MM$

 }}Y'3t9a(u':':9'EFM
 


 
s   C)C<)C9	<D	sysconfztest needs posix.sysconf()c                   V P                  \        R 4      ;_uu_ 4        \        P                  ! R4       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! R4       RRR4       \        P                  ! R4      pV P                  V^ 4       V P                  \        P                  ! \        P                  R,          4      V4       R#   + '       g   i     L; i  + '       g   i     L; i)rN  
SC_garbageNrP  rQ  
SC_ARG_MAX)rS  r,  r   rX  r9   rT  rC   sysconf_names)r#   arg_maxs   & r   test_sysconfPosixTester.test_sysconfJ  s     ##9
 
 MM,'

 ##H
 
 MM$

 ---7A&MM%--l;<g	G
 


 
s   C C3 C0	3D	dup2ztest needs posix.dup2()zWASI does not have dup2()c                \   \        \        P                  4      p\        \        P                  4      p \        P                  ! VP                  4       VP                  4       4       VP                  4        VP                  4        R #   TP                  4        TP                  4        i ; irx   )r   r   r   r   r`  r   r   )r#   fp1fp2s   &  r   	test_dup2PosixTester.test_dup2\  sk     9##$9##$	JJszz|SZZ\2IIKIIK IIKIIKs   3B	 	"B+	O_CLOEXECzneeds os.O_CLOEXECc                    \         P                  ! \        P                  \         P                  \         P
                  ,          4      pV P                  \         P                  V4       V P                  \         P                  ! V4      4       R # rx   )
rl   r   r   r   r   rf  r   r   assertFalseget_inheritabler   s   & r   test_oscloexecPosixTester.test_oscloexech  sR     WWY%%r{{2<<'?@"%++B/0rJ   O_EXLOCKztest needs posix.O_EXLOCKc                   \         P                  ! \        P                  \         P                  \         P
                  ,          \         P                  ,          4      pV P                  \        \         P                  \        P                  \         P                  \         P
                  ,          \         P                  ,          4       \         P                  ! V4       \        \        R 4      '       d   \         P                  ! \        P                  \         P                  \         P                  ,          \         P                  ,          4      pV P                  \        \         P                  \        P                  \         P                  \         P
                  ,          \         P                  ,          4       \         P                  ! V4       R# R# )O_SHLOCKN)rl   r   r   r   r   rl  r   r8   r   
O_NONBLOCKr   r   r   rn  r   s   & r   test_osexlockPosixTester.test_osexlockp  s     WWY%%[[,RZZ79'277I,<,<++bkk1"--?	A
5*%%))R[[0;=Bgrww	0@0@ kk"++5bmmCEHHRL &rJ   rn  ztest needs posix.O_SHLOCKc                   \         P                  ! \        P                  \         P                  \         P
                  ,          \         P                  ,          4      p\         P                  ! \        P                  \         P                  \         P
                  ,          \         P                  ,          4      p\         P                  ! V4       \         P                  ! V4       \        \        R 4      '       d   \         P                  ! \        P                  \         P                  \         P
                  ,          \         P                  ,          4      pV P                  \        \         P                  \        P                  \         P                  \         P                  ,          \         P                  ,          4       \         P                  ! V4       R# R# )rl  N)rl   r   r   r   r   rn  r   r   r   r   r8   r   r   rl  ro  )r#   fd1fd2r   s   &   r   test_osshlockPosixTester.test_osshlock  s     ggi&&[[,RZZ79ggi&&kk"++-bjj8:

5*%%))R[[0;=Bgrww	0@0@ kk"++5bmmCEHHRL &rJ   fstatztest needs posix.fstat()c           	        \        \        P                  4      p V P                  \        P
                  ! VP                  4       4      4       V P                  \        P                  ! VP                  4       4      4       V P                  \        R \        P                  \        VP                  4       4      4       VP                  4        R#   TP                  4        i ; iz4should be string, bytes, os.PathLike or integer, notN)r   r   r   ry   r   rw  r   statrS  r9   floatr   r   s   & r   
test_fstatPosixTester.test_fstat  s     )""#	OOEKK		45OOEJJryy{34""9JJJbiik 24 HHJBHHJs   B#C C"c           
        V P                  \        P                  ! \        P                  4      4       V P                  \        P                  ! \
        P                  ! \        P                  4      4      4       V P                  \        R \        P                  \        \
        P                  ! \        P                  4      4      4       V P                  \        R \        P                  R4       V P                  \        R \        P                  \        \        P                  4      4       V P                  \        R \        P                  \        \
        P                  ! \        P                  4      4      4       R# ry  )ry   r   rz  r   r   rl   fsencoderS  r9   r   r   r"   s   &r   	test_statPosixTester.test_stat  s    

9#3#345

2;;y/?/?#@AByF

Ibkk)2B2B&CD	F 	yF

D	" 	yF

D!1!12	4 	yF

DY-=-=!>?	ArJ   mkfifozdon't have mkfifo()c                v   \         P                  R 8X  d0   \        P                  P	                  R\
        P                  4      pM\
        P                  p\
        P                  ! V4       V P                  \
        P                  V4        \        P                  ! V\        P                  \        P                  ,          4       V P!                  \        P"                  ! \        P                  ! V4      P$                  4      4       R#   \         d#   pT P                  RT,          4        Rp?LmRp?ii ; i)vxworksz/fifos/posix.mkfifo(): %sN)r   r  rl   r   joinr   r   r   r   r   r  rz  S_IRUSRS_IWUSRPermissionErrorr   ry   S_ISFIFOst_mode)r#   	fifo_pathr   s   &  r   test_mkfifoPosixTester.test_mkfifo  s    <<9$Y	0@0@AI!((I#	(()4	4LLDLL4<<$?@ 	ejj&;&C&CDE  	4MM.233	4s   :D D8D33D8mknodS_IFIFOzdon't have mknod()/S_IFIFOc                   \         P                  ! \         P                  4       \        P                  \        P
                  ,          \        P                  ,          p \        P                  ! \         P                  V^ 4       V P                  \        P                  ! \        P                  ! \         P                  4      P                  4      4       \         P                  ! \         P                  4        \        P                  ! \         P                  V^ RR7       R#   \         dT   pT P                  TP                  \        P                  \        P                   \        P"                  34        Rp?LRp?ii ; i  \         dU   pT P                  TP                  \        P                  \        P                   \        P"                  34        Rp?R# Rp?ii ; i)r   N)r   modedevicedir_fd)r   r   r   rz  r  r  r  r   r  ry   r  r  r   assertInr   rs   r   EACCES)r#   r  r   s   &  r   
test_mknodPosixTester.test_mknod  s+   
 	))*||dll*T\\9	QKK	(($2 OODMM%**Y5E5E*F*N*NOP 	))*	NKKY--D  	N MM!''EKKu||#LMM	N  	NMM!''EKKu||#LMM	Ns2    &D& <(F &F1A	E??FG&A	G!!G&makedevztest needs posix.makedev()c                   \         P                  ! \        P                  4      pVP                  pV P                  V\        4       V P                  V^ 4       \         P                  ! V4      pV P                  V\        4       V P                  V^ 4       V P                  \         P                  ! V4      V4       V P                  \        \         P                  \        V4      4       V P                  \        \         P                  4       R F.  pV P                  \        \        3\         P                  V4       K0  	  \         P                  ! V4      pV P                  V\        4       V P                  V^ 4       V P                  \         P                  ! V4      V4       V P                  \        \         P                  \        V4      4       V P                  \        \         P                  4       R F.  pV P                  \        \        3\         P                  V4       K0  	  V P                  \         P                   ! W54      V4       V P                  \        \         P                   \        V4      V4       V P                  \        \         P                   V\        V4      4       V P                  \        \         P                   V4       V P                  \        \         P                   4       R FY  pV P                  \        \        3\         P                   WE4       V P                  \        \        3\         P                   W44       K[  	  \"        P$                  R8X  d   \&        P(                  ! 4       '       gw   RpV P                  \         P                  ! V4      V4       V P                  \         P                  ! V4      V4       V P                  \         P                   ! Wf4      V4       R# R# R# )r   linuxN)                    )r          r  r  rT   )r   rz  r   r   st_devrI  r+  rE   majorrC   r8   r9   r{  r,  OverflowErrorminorr  r   r  r   linked_to_musl)r#   stdevr  xr  NODEVs   &      r   test_makedevPosixTester.test_makedev  s   ZZ	(()iic3'Q'C eS)q)S)51)U[[%*=)U[[1$Az=95;;J % C eS)q)S)51)U[[%*=)U[[1$Az=95;;J % 	u4c:)U]]E%L%H)U]]E5<H)U]]E:)U]]3+Az=95==!Sz=95==%S , <<7"7+A+A+C+CEU[[/7U[[/7U]]58%@	 ,D"rJ   c           
     <  a aa VV V3R  lp\         P                  ! 4       p\         P                  ! 4       pV! SWV4       V! WV4       V! SRV4       V! WV4       V! SVR4       V! WV4       \        P                  R8X  d   VR9   pMV^ 8H  p\
        P                  '       d   EMV'       dO   \        P                  R8w  d   RMRpV! SW4       V! W4       V! SRR4       V! W4       V! SWV4       V! WV4       M\        P                  ! 4       R	9   d   \        P                  ! R4      hS P                  \        VS^ ^ 4       V! WV4       S P                  \        VS^ R4       V! WV4       \        \         R4      '       d<   ^ \         P                  ! 4       9  d"   S P                  \        VSR^ 4       V! WV4       \        \        3 FP  p	S P                  \         VSV	! V4      V4       V! WV4       S P                  \         VSWY! V4      4       V! WV4       KR  	  R# )
c                    < SeC   S! S4      pSP                  VP                  V 4       SP                  VP                  V4       R # R # rx   )rC   st_uidst_gid)uidgidrz  first_paramr#   	stat_funcs   && r   
check_stat6PosixTester._test_all_chown_common.<locals>.check_stat   s@    $ -  c2  c2 %rJ   r  z1Skipping because of non-standard chown() behaviorr0   NrT   )r   rS   l        r   )zHP-UXSunOS)rl   r4   r/   r   r  r   is_emscriptensystemrp   rq   r8   r   r   r0   strr{  r9   )
r#   
chown_funcr  r  r  r  r  is_root	big_valuets
   f&ff      r   _test_all_chown_common"PosixTester._test_all_chown_common  s   	3
 iikiik;)3;C(3;R(3<<9$ f}GaxG    " #&,,)";I{I9y,{B+y,{C-s __"44 ## %/ 0 0 gz;1Es gz;2Fs r;''BLLN*%%gz;ANs(eAi[!C&#Ns i[#qvNs 	 rJ   chownzrequires os.chown()getgid() is a stubc                z   \         P                  ! \        P                  4       V P	                  \
        \        P                  \        P                  RR4       \        P                  ! \        P                  4       V P                  \        P                  \        P                  \        P                  4       R# rR   )rl   r   r   r   r8   r   r   r  create_empty_filer  rz  r"   s   &r   
test_chownPosixTester.test_chownG  sl     			)""#'5;;	0@0@"bI 	##I$4$45##EKK1A1A5::NrJ   fchownztest needs os.fchown()c           	     N   \         P                  ! \        P                  4       \	        \        P                  R 4      p VP                  4       pV P                  \        P                  V\        \        RR4      4       VP                  4        R#   TP                  4        i ; i)r   rw  N)rl   r   r   r   r   r   r  r   r  r6   r   )r#   	test_filer   s   &  r   test_fchownPosixTester.test_fchownR  sw     			)""# ))3/		!!#B''b(/w(EG OOIOOs    A B B$lchownztest needs os.lchown()c           	        \         P                  ! \        P                  4       \         P                  ! \
        \        P                  4       V P                  \        P                  \        P                  \        \        R R4      4       R# )lstatN)
rl   r   r   r   symlink_DUMMY_SYMLINKr  r   r  r6   r"   s   &r   test_lchownPosixTester.test_lchowna  sS     			)""#


>9#3#34##ELL)2B2B$+E7D$A	CrJ   r   ztest needs posix.chdir()c                    \         P                  ! \        P                  4       V P	                  \
        \         P                  \        P                  4       R # rx   )r   r   rl   rz   r8   r   r   r   r"   s   &r   
test_chdirPosixTester.test_chdirj  s.    BII'5;;	0@0@ArJ   c                    V P                  \        P                  \        P                  ! \
        P                  4      4       R # rx   )r  r   r   r   listdirrl   rz   r"   s   &r   test_listdirPosixTester.test_listdiro  s#    i&&bii(@ArJ   c                l    V P                  \        P                  \        P                  ! 4       4       R # rx   )r  r   r   r   r  r"   s   &r   test_listdir_default PosixTester.test_listdir_defaultr  s     	i&&8rJ   c                    V P                  \        P                  ! \        P                  4      \
        P                  ! R 4      4       R#    .N)r  rl   r  r   r   r   r  r"   s   &r   test_listdir_bytesPosixTester.test_listdir_bytesw  s*     	bkk)"2"23U]]45HIrJ   c                    \         \        3 FE  pV P                  \        4      ;_uu_ 4        \        P
                  ! V! R 4      4       RRR4       KG  	  R#   + '       g   i     K\  ; ir  )r   
memoryviewr8   r9   r   r  )r#   clss   & r   test_listdir_bytes_like#PosixTester.test_listdir_bytes_like|  sD    j(C""9--c$i( .- )---s   AA)z)test needs fd support for posix.listdir()c                   \         P                  ! \         P                  ! 4       \         P                  4      pV P	                  \         P
                  V4       V P                  \        \         P                  ! R 4      4      \        \         P                  ! V4      4      4       V P                  \        \         P                  ! R 4      4      \        \         P                  ! V4      4      4       R# ).N)	r   r   r(   r   r   r   rC   sortedr  r#   fs   & r   test_listdir_fdPosixTester.test_listdir_fd  s     JJu||~u~~6Q'5==%&5==#$	
 	5==%&5==#$	rJ   accessztest needs posix.access()c                    V P                  \        P                  ! \        P                  \
        P                  4      4       R # rx   )ry   r   r  r   r   rl   R_OKr"   s   &r   test_accessPosixTester.test_access  s#    Y%5%5rww?@rJ   umaskztest needs posix.umask()c                    \         P                  ! ^ 4      pV P                  V\        4       \         P                  ! V4       R# r  )r   r  rI  r+  )r#   old_masks   & r   
test_umaskPosixTester.test_umask  s+    ;;q>h,HrJ   strerrorztest needs posix.strerror()c                P    V P                  \        P                  ! ^ 4      4       R# r  )ry   r   r  r"   s   &r   test_strerrorPosixTester.test_strerror  s     	q)*rJ   pipeztest needs posix.pipe()c                    \         P                  ! 4       w  r\        P                  ! V4       \        P                  ! V4       R # rx   )r   r  rl   r   )r#   readerwriters   &  r   	test_pipePosixTester.test_pipe  s'    

rJ   pipe2ztest needs os.pipe2()c                   V P                  \        \        P                  R 4       V P                  \        \        P                  ^ ^ 4       \        P                  ! ^ 4      w  r\        P                  ! V4       \        P                  ! V4       \        P                  ! \        P
                  \        P                  ,          4      w  rV P                  \        P                  V4       V P                  \        P                  V4       V P                  \        P                  ! V4      4       V P                  \        P                  ! V4      4       V P                  \        P                  ! V4      4       V P                  \        P                  ! V4      4       V P                  \        \        P                  V^4        \        P                  ! VR\        P                  ,          4       R#   \         d     R# i ; i)DEADBEEFr  N)r8   r9   rl   r   r   rf  ro  r   rh  ri  get_blockingr   r   r   r   PIPE_MAX_SIZE)r#   rr   s   &  r   
test_pipe2PosixTester.test_pipe2  sD    	)RXXz:)RXXq!4 xx{

 xxR]]23!$!$++A./++A./+,+,'277Aq1	HHQw4445 		s   ,G4 4HHc                    ^ RI pV P                  \        \        P                  VP
                  ^,           4       V P                  \        \        P                  VP                  ^,           4       R# r  )	_testcapir8   r  rl   r   INT_MAXUINT_MAX)r#   r	  s   & r   test_pipe2_c_limitsPosixTester.test_pipe2_c_limits  sI    
 	-93D3Dq3HI-93E3E3IJrJ   r*  ztest needs posix.utime()c                x   \         P                   ! 4       p\        P                  ! \        P                  R 4       V P                  \        \        P                  \        P                  R4       V P                  \        \        P                  \        P                  VR 34       V P                  \        \        P                  \        P                  R V34       \        P                  ! \        P                  \        V4      \        V4      34       \        P                  ! \        P                  W34       R # )Nr(  r3  r4  s   & r   
test_utimePosixTester.test_utime  s    iikI$$d+)U[[#**L	:)U[[#**S$K	9)U[[#**T3K	9I$$s3xS&:;I$$sj1rJ   c                   \        V\        4      '       * p\        P                  ! V4      P                  p V\        P
                  \        P                  ,          \        P                  ,          ( ,          pV! W&3/ VB  V P                  \        P                  ! V4      P                  V4       \        P                  ! V4      '       d"    \        VR VR7      ;_uu_ 4         RRR4       V\        P
                  \        P                  ,          \        P                  ,          ,          pV! W&3/ VB  V P                  \        P                  ! V4      P                  V4       \        P                  ! V4      '       d!   \        VR VR7      ;_uu_ 4         RRR4       V! W%4       R#   + '       g   i     L; i  \         d     Li ; i  + '       g   i     L>; i  T! Y%4       i ; i)wb+)closefdN)
isinstancer+  rl   rz  r  S_IWOTHS_IWGRPr  rC   S_ISREGr   r  )r#   
chmod_functargetkwargsr  r  new_modes   &&&,   r   check_chmodPosixTester.check_chmod  sM    --wwv&&	%t|| ;dll JKKHv262RWWV_44h?||D!!feW== > t||dll:T\\IJHv262RWWV_44h?||D!!&%99 : v$ >=&  :9 v$sm   BG& G %F/'G /B,G& GG& /F?	:G >G& ?G GG& GG& G#	G& &
G0c                b    V P                  \        P                  \        P                  4       R # rx   )r  r   chmodr   r   r"   s   &r   test_chmod_filePosixTester.test_chmod_file  s    i&6&67rJ   c                    \         P                  R ,           p\        P                  ! V4       V P	                  \        P
                  V4       V# )d)r   r   r   mkdirr   rmdirr#   r  s   & r   tempdirPosixTester.tempdir  s5    !!C'FV,rJ   c                f    V P                  4       pV P                  \        P                  V4       R # rx   )r'  r  r   r  r&  s   & r   test_chmod_dirPosixTester.test_chmod_dir  s!    f-rJ   c                <   \        \        P                  R 4      ;_uu_ 4       pV P                  \        P
                  VP                  4       4       V P                  \        P                  VP                  4       4       RRR4       R#   + '       g   i     R# ; i)r  N)r   r   r   r  r   fchmodr   r  r  s   & r   test_fchmod_filePosixTester.test_fchmod_file  sZ    )""E**aU\\188:6U[[!((*5 +***s   AB

B	lchmodztest needs os.lchmod()c                    V P                  \        P                  \        P                  4       V P                  \        P
                  \        P                  R R7       R# Fr1  N)r  r   r0  r   r   r  r"   s   &r   test_lchmod_filePosixTester.test_lchmod_file  s;    y'7'78i&6&6NrJ   c                    V P                  4       pV P                  \        P                  V4       V P                  \        P                  VR R7       R# r2  )r'  r  r   r0  r  r&  s   & r   test_lchmod_dirPosixTester.test_lchmod_dir  s:    v.feDrJ   c                   \         P                  ! V4      P                  p\         P                  ! V4      P                  p V\        P                  \        P
                  ,          \        P                  ,          ( ,          pV! W73/ VB  V P                  \         P                  ! V4      P                  V4       V P                  \         P                  ! V4      P                  V4       V\        P                  \        P
                  ,          \        P                  ,          ,          pV! W73/ VB  V P                  \         P                  ! V4      P                  V4       V P                  \         P                  ! V4      P                  V4       \        P                  ! W%4       R #   \        P                  ! Y%4       i ; irx   )
rl   rz  r  r  r  r  r  rC   r   r  r#   r  r  linkr  target_mode	link_moder  s   &&&&,   r   check_chmod_linkPosixTester.check_chmod_link  s   ggfo--HHTN**	
	-"t||dll'BT\\'Q%RRHt00RWWV_44h?RXXd^33Y?"dllT\\&ADLL&PQHt00RWWV_44h?RXXd^33Y?KK,EKK,s   EF/ /Gc                0   \         P                  ! V4      P                  p\         P                  ! V4      P                  pV\        P                  \        P
                  ,          \        P                  ,          ( ,          pV! W73/ VB  V P                  \         P                  ! V4      P                  V4       V P                  \         P                  ! V4      P                  V4       V\        P                  \        P
                  ,          \        P                  ,          ,          pV! W73/ VB  V P                  \         P                  ! V4      P                  V4       V P                  \         P                  ! V4      P                  V4       R # rx   )rl   rz  r  r  r  r  r  rC   r9  s   &&&&,   r   check_lchmod_linkPosixTester.check_lchmod_link  s    ggfo--HHTN**	!<t||!KLL4,V,00+>$//:t|| ;dll JK4,V,00+>$//:rJ   c                   \         P                  p\         P                  R ,           p\        P                  ! W4       V P	                  \
        P                  V4       \        P                  R8X  d"   V P                  \
        P                  W4       M V P                  \
        P                  W4       V P                  \
        P                  WRR7       R# )-linkntTr1  N)r   r   rl   r  r   r   r   r;   r@  r  r=  r#   r  r:  s   &  r   test_chmod_file_symlink#PosixTester.test_chmod_file_symlink(  s    !!')


6 d+77d?""5;;=!!%++v<ekk6NrJ   c                   V P                  4       p\        P                  R ,           p\        P                  ! WRR7       V P                  \        P                  V4       \        P                  R8X  d"   V P                  \        P                  W4       M V P                  \        P                  W4       V P                  \        P                  WRR7       R# )rC  T)target_is_directoryrD  r1  N)r'  r   r   rl   r  r   r   r   r;   r@  r  r=  rE  s   &  r   test_chmod_dir_symlink"PosixTester.test_chmod_dir_symlink4  s    ')


6T:d+77d?""5;;=!!%++v<ekk6NrJ   c                D   \         P                  p\         P                  R ,           p\        P                  ! W4       V P	                  \
        P                  V4       V P                  \
        P                  WRR7       V P                  \
        P                  W4       R# rC  Fr1  N)
r   r   rl   r  r   r   r   r@  r  r0  rE  s   &  r   test_lchmod_file_symlink$PosixTester.test_lchmod_file_symlink@  sj     !!')


6 d+u{{F%Pu||V:rJ   c                D   V P                  4       p\        P                  R ,           p\        P                  ! W4       V P                  \        P                  V4       V P                  \        P                  WRR7       V P                  \        P                  W4       R# rM  )r'  r   r   rl   r  r   r   r   r@  r  r0  rE  s   &  r   test_lchmod_dir_symlink#PosixTester.test_lchmod_dir_symlinkJ  sj     ')


6 d+u{{F%Pu||V:rJ   c                   \         P                  ! V4      pV P                  VR 4       VP                  \        P                  ,          p V! W%3/ VB   \         P                  ! V4      pV P                  VP                  \        P                  ,          VP                  4        \        VR4      p	\        P                  ! W$P                  4       R#   \
         d>   pTP                  \        P                  8w  d   h RpT P                  T4        Rp?LRp?ii ; i  \
         d5   p
T P                  T
P                  \        P                  4        Rp
?
LRp
?
ii ; i  \        P                  ! Y$P                  4       i ; i)st_flags2chflag UF_IMMUTABLE not supported by underlying fsNr   )rl   rz  assertHasAttrrT  UF_IMMUTABLEr   r   r  r   rC   r   rs   r   chflags)r#   chflags_functarget_filer  r  flagserrr   new_str   r   s   &&&,       r   _test_chflags_regular_file&PosixTester._test_chflags_regular_fileT  s   WW[!2z* d///	6v6	4WW[)FR[[4+<+<<fooN7+t, MM+{{3  	yyE,,,FCMM#		  7  %++667 MM+{{3sI   	C AE" 'D  D 3DD E+*EE" EE" ""FrX  ztest needs os.chflags()c                b    V P                  \        P                  \        P                  4       R # rx   )r^  r   rX  r   r   r"   s   &r   test_chflagsPosixTester.test_chflagsl  s    ''y7G7GHrJ   lchflagsztest needs os.lchflags()c                    V P                  \        P                  \        P                  4       V P                  \        P
                  \        P                  R R7       R# r2  )r^  r   rc  r   r   rX  r"   s   &r   test_lchflags_regular_file&PosixTester.test_lchflags_regular_filep  s@    ''	8H8HI''y7G7G8= 	( 	?rJ   c                   \         P                  ! \        P                  4      pV P	                  VR 4       V P                  \        P                  \        4       \         P                  ! \        P                  \        4       \         P                  ! \        4      pR p\        P                  V3 F  pVP                  \        P                  ,          p V! \        V4        \         P                  ! \        P                  4      p\         P                  ! \        4      p	V P%                  VP                  VP                  4       V P%                  VP                  \        P                  ,          V	P                  4       V! \        VP                  4       K  	  R#   \         d?   pTP                  \        P                   8w  d   h RpT P#                  T4        Rp?ELRp?ii ; i  T! \        TP                  4       i ; i)rT  c                 2    \         P                  ! WR R7      # )Fr1  )r   rX  )r   r[  s   &&r   chflags_nofollow;PosixTester.test_lchflags_symlink.<locals>.chflags_nofollow  s    ==eDDrJ   rU  N)rl   rz  r   r   rV  r   r   r  r  r  r   rc  rT  rW  r   r   r  r   rC   )
r#   	testfn_stdummy_symlink_stri  fnr[  r\  r   new_testfn_stnew_dummy_symlink_sts
   &         r   test_lchflags_symlink!PosixTester.test_lchflags_symlinkv  sp   GGI,,-	9j1	((.9


9##^488N3	E >>#34B$--0A0AAE#>5)> "	(8(8 9')xx'?$  !3!3]5K5KL  !1!:!:T=N=N!N!5!>!>@ >#3#<#<=% 5
  #99 0 00Jc""	# >#3#<#<=s%   F"&BG."G+-3G&&G+.Hc                   \         P                  R 8X  d   \        pM\        p\        P
                  P                  4        F;  w  r#V P                  \        V4      V4       V P                  \        V4      V4       K=  	  R# )rD  N)	rl   r;   r  r   r   r   itemsrC   type)r#   	item_typekvs   &   r   test_environPosixTester.test_environ  sX    77d?IIMM'')DAT!Wi0T!Wi0 *rJ   c                   V P                  \        4      ;_uu_ 4        \        P                  ! R R4       RRR4       V P                  \        4      ;_uu_ 4        \        P                  ! RR4       RRR4       V P                  \        4      ;_uu_ 4        \        P                  ! RR4       RRR4       \        P                  R8X  d   V P                  \        4      ;_uu_ 4        \        P                  ! RR	4       RRR4       V P                  \        4      ;_uu_ 4        \        P                  ! R
R4       RRR4       V P                  \        4      ;_uu_ 4        \        P                  ! RR4       RRR4       R# R#   + '       g   i     EL[; i  + '       g   i     EL2; i  + '       g   i     EL	; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)zFRUIT VEGETABLEcabbageNFRUITzorange VEGETABLE=cabbagezFRUIT=ORANGElemonr   s   FRUIT VEGETABLEs   cabbages   FRUITs   orange VEGETABLE=cabbages   FRUIT=ORANGEs   lemon)r8   r,  rl   putenvr;   r"   s   &r   test_putenvPosixTester.test_putenv  s,   z**II()4 +z**IIg:; +z**IIng. +77g"":..		-z: /"":..		($@A /"":..		/84 /.  +******** /......sG   FFF0*G'G$G*F	F-	0G	G	G'	*G;	r(   ztest needs posix.getcwd()c                  a R p\         P                  ! 4       p\         P                  P                  \        P
                  4      R,           p \         P                  ! V4       \         P                  ! V4        \         P                  ! T4       \        P                  ! T4       R#     \         P                  ! T4       \        P                  ! T4       R# ; i  \         P                  ! T4       \        P                  ! T4       i ; i)z8getcwd-test-directory-0123456789abcdef-01234567890abcdefz.getcwdN)	rl   r(   r   abspathr   r   r$  r   rmtree)r#   dirnamerz   	base_path_create_and_do_getcwds   &   @r   test_getcwd_long_pathnames&PosixTester.test_getcwd_long_pathnames  s    LGGOOI$4$45	A		(HHYHHY2 HHVY'3	+ ( HHVY' HHVY's   ,B) )C+C C .Dgetgrouplistztest needs posix.getgrouplist()r4   ztest needs os.getuid()c                   \         P                  ! \        P                  ! 4       4      ^ ,          p\         P                  ! \        P                  ! 4       4      ^,          pV P	                  V\
        P                  ! W4      4       R# r  )rm   rh   rl   r4   r  r   r  )r#   usergroups   &  r   test_getgrouplistPosixTester.test_getgrouplist  sO     ||BIIK(+RYY[)!,eU//<=rJ   r-   ztest needs os.getegid()popenztest needs os.popen()c                   \         P                  ! R 4      ;_uu_ 4       pVP                  4       P                  4       pVP	                  4       pRRR4        \        R XP                  4        4       4      pXf	   V'       g   \        P                  ! R4      h\        P                  R8X  d   ^ RIpVP                  R4      ;'       g    Rp\        ;QJ d*    . R VP                  R4      R	,           4       F  NK  	  5M#! R VP                  R4      R	,           4       4      R8  d   \        P                  ! R
4      hVP                  \         P"                  ! 4       4      pT P%                  V'       * ;'       g    V\         P&                  ! 4       08H  4       R#   + '       g   i     ELX; i  \         d    \        4       p ELRi ; i)zid -G 2>/dev/nullNc              3   8   "   T F  p\        V4      x  K  	  R # 5irx   r+  ).0gs   & r   	<genexpr>-PosixTester.test_getgroups.<locals>.<genexpr>  s     <^SVV^   zneed working 'id -G'darwinMACOSX_DEPLOYMENT_TARGETz10.3c              3   8   "   T F  p\        V4      x  K  	  R # 5irx   r  )r  r   s   & r   r  r    s     8%7SVV%7r  r  :r   r   Nz$getgroups(2) is broken prior to 10.6)
      )rl   r  r   stripr   setr   r,  rp   rq   r   r  	sysconfigget_config_vartuplesymmetric_differencer   r0   ry   r-   )r#   idggroupsret
idg_groupsr  dtsymdiffs   &       r   test_getgroupsPosixTester.test_getgroups  sG    XX)**cXXZ%%'F))+C +	<V\\^<<J ?*##$:;; <<8#))*DEOOBu8RXXc]3%78uu8RXXc]3%7887B''(NOO 11%//2CDGCCw5==?2C'CD/ +**  	J	s   /F F1 F.	1G
	G
SIGCHLDz2CLD_XXXX be placed in si_code for a SIGCHLD signalwaitid_resultztest needs os.waitid_resultc                    \         P                   \         P                   \         P                   \         P                   \         P
                   \         P                   R # rx   )rl   
CLD_EXITED
CLD_KILLED
CLD_DUMPEDCLD_TRAPPEDCLD_STOPPEDCLD_CONTINUEDr"   s   &r   test_cld_xxxx_constants#PosixTester.test_cld_xxxx_constants  s0     	




rJ   sched_yieldzdon't have scheduling supportsched_setaffinityz!don't have sched affinity supportc                0    \         P                  ! 4        R # rx   )r   r  r"   s   &r   test_sched_yieldPosixTester.test_sched_yield  s     	rJ   sched_get_priority_maxz!requires sched_get_priority_max()c                   \         P                  p\         P                  ! V4      p\         P                  ! V4      pV P	                  V\
        4       V P	                  V\
        4       V P                  W24       \        '       gM   V P                  \        \         P                  R4       V P                  \        \         P                  R4       R# R# )   Ni)
r   SCHED_RRsched_get_priority_minr  rI  r+  rE   r   r8   r   )r#   pollohis   &   r   test_sched_priorityPosixTester.test_sched_priority  s    
 nn))#.))#.b#&b#&'xgu'C'CSIgu'C'CSI rJ   c                   \         P                  P                  4        UUu. uF   w  rVP                  R 4      '       g   K  VNK"  	  ppp\         P                  ! ^ 4      pV P                  WC4        \         P                  ! \        P                  ! 4       4      pV P                  WS4       V P                  \        \         P                  R4       V P                  \        \         P                  R4       \         P                  ! ^ 4      pV P                  VP                  \        4       \        P                   P                  R4      '       gV    \         P"                  ! ^ WF4       \         P$                  ! ^ V4       V P                  \        \         P$                  RV4       V P                  \        \         P"                  RWF4       V P                  \&        \         P"                  ^ VR4       V P                  \&        \         P$                  ^ ^+4       \         P(                  ! R4      pV P                  \&        \         P$                  ^ V4       Rp\         P(                  ! V4      pV P                  \*        \         P$                  ^ V4       \         P(                  ! V) R7      pV P                  \*        \         P$                  ^ V4       R# u uppi   \         d     EL;i ; i  \         d     ELyi ; i)SCHED_Nl    sched_priorityrT   r  r  )r   __dict__rs  r  r   r  rl   r3   r  r8   r   sched_getparamrI  r  r+  r   r  sched_setschedulersched_setparamr9   sched_paramr  )r#   r;   schedpossible_schedulersmineparentparamlarges   &       r   $test_get_and_set_scheduler_and_param0PosixTester.test_get_and_set_scheduler_and_param  s5   8=8L8L8N =8N"&//(";  %u8N =''*d0	7--bjjl;F MM&6'5#;#;R@'5#7#7<$$Q'e22C8
 ||&&'<==((D8$$Q. gu';';RG'5#;#;RM)U%=%=q$M)U%9%91bA!!$')U%9%91eD!!%(-)=)=q%H!!%8-)=)=q%HK=  	 	$ # s/   KK3)K .K, K)(K),K;:K;c                   \         P                  ! ^4      p\        \        P                  ^,           4       F>  p\        P
                  ! \        P                  ! W4      4      pV P                  W14       K@  	  \        P                  ! V4      pV P                  W14       V P                  W14       \        P                  ! V4      pV P                  W14       V P                  W14       \        P                  ! V4      pV P                  W14       V P                  W14       \        P                  ! V^ R7      pV P                  W14       V P                  VP                  ^ 4       R# )rS   r  N)r   r  rangepickleHIGHEST_PROTOCOLloadsdumpsrC   copyassertIsNotdeepcopyreplaceassertNotEqualr  )r#   r  protonewparams   &   r   test_sched_paramPosixTester.test_sched_paramF  s   !!!$622145E||FLL$>?HX- 6 99U#))=='))<<&))<<a8H,00!4rJ   sched_rr_get_intervalzno functionc                :    \         P                  ! ^ 4      pV P                  X\        4       V P                  VR4       V P                  VR4       R#   \         d<   pTP                  \        P                  8w  d   h T P                  R4        Rp?L}Rp?ii ; i)r   z only works on SCHED_RR processesNg        g      ?)
r   r  r   r   r   r   rI  r{  rE   
assertLess)r#   intervalr   s   &  r   test_sched_rr_get_interval&PosixTester.test_sched_rr_get_intervalY  s~    	>2215H 	h."-"%  	> ww%,,&MM<==	>s   A B1BBc                   \         P                  ! ^ 4      pV P                  V\        4       V P	                  \        V4      ^4       \        P                  P                  R4      '       g&   V P                  \        \         P                  R4       V F=  pV P                  V\        4       V P	                  V^ 4       V P                  VR4       K?  	  R# )r   r  NrT   r  )r   sched_getaffinityrI  r  rE   rD   r   r  r  r8   r   r+  r  )r#   maskcpus   &  r   test_sched_getaffinity"PosixTester.test_sched_getaffinityh  s    &&q)dC(D	1-||&&y11gu'>'>CC!!#s+##C+OOC) rJ   c           	     >   \         P                  ! ^ 4      pV P                  \         P                  ^ \	        V4      4       \        V4      ^8  d   VP                  4        \         P                  ! ^ V4       V P                  \         P                  ! ^ 4      V4        \         P                  ! ^ . 4       V P                  \        \         P                  ^ R.4       V P                  \        \         P                  ^ \        \        R4      4       V P                  \        \         P                  ^ ^^,          .4       \        P                  P!                  R4      '       g)   V P                  \        \         P                  RV4       R# R#   \         d     Li ; i)r   0Xr  NirT   )r   r  r   r  r   rD   poprC   r   r8   r,  mapr+  r  r   r  r  )r#   r  s   & r   test_sched_setaffinity"PosixTester.test_sched_setaffinityu  s(   &&q)//DJ?t9q=HHJ4(003T:	##Ar* 	*e&=&=q3%H*e&=&=q#c4.Q-)@)@!afXN||&&y11gu'>'>DI 2  	 	s   F FFzNo dynamic linking on WASIr   zPOSIX-only testc                    \         P                   \         P                   \         P                   \         P                   R # rx   )r   	RTLD_LAZYRTLD_NOWRTLD_GLOBAL
RTLD_LOCALr"   s   &r   test_rtld_constantsPosixTester.test_rtld_constants  s$     	rJ   	SEEK_HOLEz(test needs an OS that reports file holesc                   \        \        P                  R 4      ;_uu_ 4       pVP                  R4       VP	                  4        VP                  4       pVP                  4       p \        V4       Fm  pV P                  V\        P                  ! W4\        P                  4      4       V P                  V\        P                  ! W4\        P                  4      4       Ko  	  V P                  \        \        P                  W2\        P                  4       V P                  \        \        P                  W2\        P                  4        RRR4       R#   \         d    \         P"                  ! R4      hi ; i  + '       g   i     R# ; i)zr+bs   hellozOSError raised!N)r   r   r   r   r   tellr   r  rC   rl   r   	SEEK_DATAassertLessEqualr  r8   r   rp   rq   )r#   r   r:  fnor   s   &    r   test_fs_holesPosixTester.test_fs_holes  s    )""E**bHHXHHJ779D))+C;tA$$Q(FG((rxx/MN % !!'288SM!!'288SM +*  ;
 ''(9::; +**s   AE:&C$E"E77E::F	c           	     D   R FU  p\        \        VR4      pVf   K  R\        P                  3 F  p V! RV4       K  	  V P                  RV,           4       KW  	  R#   \         d7   pT P                  RP                  T4      \        T4      4        Rp? K  Rp?ii ; i)renameNnoodly2doesnotexistfilenamez'doesnotexistfilename' -> '{}'z#No valid path_error2() test for os.)r  r  r:  )	r6   rl   r   r   r   r  formatr  rr   )r#   r;   functiondstr   s   &    r   test_path_error2PosixTester.test_path_error2  s     2Dr4.H!9#3#343S9 5 		?$FG 2  MM"B"I"I#"NPSTUPVWs   	AB)*BBc                   \         P                  pVR ,           pV P                  \         P                  V4       \         P                  ! V4       Rp V P	                  \
        4      ;_uu_ 4        \        P                  ! V\        P                  \        P                  ,          4      pRRR4       Ve   \        P                  ! V4       T P                  \        P                  P                  T4      4       T P	                  \
        \        P                  T4       T P                  \        P                  P                  T4      4       \        TR4      P                  4        T P	                  \
        \        P                  T4       R#   + '       g   i     L; i  Te   \        P                  ! T4       i i ; i) Nr   )r   r   r   r   r8   r,  rl   r   r   r   r   rh  r   existsr$  rz  r#   rm  fn_with_NULr   s   &   r   test_path_with_null_character)PosixTester.test_path_with_null_character  s   4i	(("-	"":..WW["++

*BC / ~+,*bhh<+,R*bgg{; /. ~ s$   F" 0;F+F" F	F" "F?c                   \         P                  ! \        P                  4      pVR ,           pV P	                  \        P
                  V4       \        P
                  ! V4       Rp V P                  \        4      ;_uu_ 4        \         P                  ! V\         P                  \         P                  ,          4      pRRR4       Ve   \         P                  ! V4       T P                  \         P                  P                  T4      4       T P                  \        \         P                  T4       T P                  \         P                  P                  T4      4       \        TR4      P                  4        T P                  \        \         P                   T4       R#   + '       g   i     L; i  Te   \         P                  ! T4       i i ; i)r   Nr   )rl   r  r   r   r   r   r8   r,  r   r   r   r   rh  r   r  r$  rz  r  s   &   r   test_path_with_null_byte$PosixTester.test_path_with_null_byte  s%   [[))*5j	(("-	"":..WW["++

*BC / ~+,*bhh<+,R*bgg{; /. ~ s$   'F6 ;F#?F6 #F3	.F6 6G
pidfd_openzpidfd_open unavailablec                z   V P                  \        4      ;_uu_ 4       p\        P                  ! R4       RRR4       XP                  P
                  \
        P                  8X  d   V P                  R4       \        VP                  \        4      '       d    V P                  RVP                  : 24       V P                  VP                  P
                  \
        P                  4       \        P                  ! \        P                  ! \        P                  ! 4       ^ 4      4       R#   + '       g   i     L; i)rS   Nz"system does not support pidfd_openzpidfd_open syscall blocked: rT   )r8   r   rl   r  r   r   r   r   r  r  rC   r   r   r1   )r#   r   s   & r   test_pidfd_openPosixTester.test_pidfd_open  s    w''2MM" (<<-MM>?bllO44MM88HIJ++U\\:
ryy{A./ ('s   D**D:	c                   \         P                  P                  R4      p\         P                  P                  R4      p\        P                  pVR,           p\
        P                  ! W44       V P                  \        P                  V4       V P                  R4      ;_uu_ 4        VR,           p\
        P                  ! WE4       V P                  \        P                  V4       \        P                  \        P                  9   g	   V'       d<   V P                  \
        P                  ! V4      \
        P                  ! V4      4       MBV'       d;   V P                  \
        P                  ! V4      \
        P                  ! V4      4       RRR4       V P                  R4      ;_uu_ 4        VR,           p \
        P                  ! WERR7       V P                  \        P                  V4       V P                  \
        P                  ! V4      \
        P                  ! V4      4       RRR4       V P                  R	4      ;_uu_ 4        VR
,           p \
        P                  ! WERR7       V P                  \        P                  V4       V P                  \
        P                  ! V4      \
        P                  ! V4      4       RRR4       R#   + '       g   i     ELO; i  \         d0    \        P                  \        P                  9   g	   T'       d   h  Li ; i  + '       g   i     EL; i  \         d0    \        P                  \        P                  9   g	   T'       d   h  Li ; i  + '       g   i     R# ; i)r  r  zno follow_symlinksr:  Nzfollow_symlinks=Falselink_nofollowFr1  zfollow_symlinks=Truelink_followingT)r  r  r  r  	dragonflysunos5)win32r  )r   r  r  r   r   r   r  r   r   r7   r:  rl   supports_follow_symlinksrC   r  r   )r#   default_followdefault_no_followorigr  r:  s   &     r   test_link_follow_symlinks%PosixTester.test_link_follow_symlinks  s]    00MOLL334FG"d$	(('2\\.//&=DJJw%OOI,,d3ww"555  T!2EKK4EF"  T!2EKK4HI 0 \\122/)DJ

7%@
 	 0 0$7  T!2EKK4HI 3 \\011**DG

7$?
 	 0 0$7  T!2EKK4EF 21- 0// ' 77b999=N >O 322" ' 77b999^ >L 211s   'A*KAK:K0
L&;K)AL&
M7L:1AM7K&	)5L#L# L&"L##L&&L7	:5M40M41M73M44M77N	r   )__name__
__module____qualname____firstlineno__r$   r=   rp   
skipUnlessr   r   rH   rN   rW   r\   ra   re   rm   rt   r{   r   r   r   r6   rl   supports_fdr   requires_forkr   r   r   r   r   r   r   requires_32br   r   r   r  r  r  r  r   r#  r*  r.  r$  r5  r;  r>  rB  rE  skipIfis_wasirJ  rV  r^  rd  requires_linux_versionrequires_subprocessrj  rp  ru  r|  r  r  rz  r  r  r  r  r  r   skip_unless_working_chmodr  r  r  r  r  r  r  r  r  r  r  r  r  r  cpython_onlyr  r  r  r   r'  r*  r.  r3  r6  r=  r@  skip_unless_symlinkrF  rJ  rN  rQ  r^  ra  re  rp  rx  r  r  r  r  signalr  requires_sched_hrequires_sched_affinityr  r  requires_schedr  r  r  r  r  r;   r  r  r  r  r  r  skip_unless_hardlinkr(  __static_attributes____classdictcell____classdict__s   @r   r   r   8   sD    0@  479,9, 479,9, 479797 479G9G 479797 479H9H 557j13NOI P7I. 	257272 
3688 4799 
35RS, T, Xt4FHyz
  {
 13NO.  P. =% =%~ 02LM	 N	 02LM	 N	 13NO P 13NO46RS T P( 13NO	  P	 13NO P 	24PQ R 	24PQ68PQ R R 	24PQ  R (9:,..( (9:,.. 8*,, 8*,, R^^35XY Z( R%@%@@Brs= t= 13NO P* 13NO  P 02LM N* 02LM	  N	 .13__W__&@A B3 	257N7N 	257G7G  /24__W__&AB C4 [13GH##Aq"-  "1 # . I1
 
3466 
3466 035
5
A" 13HIF JF 0MMWT95M57N7N, 	24PQ%A R%ANG!R W-/DE__W**,@AO B FO ((13KL__W**,@A
 B M )
 ((13KLC M )C 02LMB NBB9
J
)
 "..8DFF 13NOA PA 02LM N
 
368+8+ /1JK L
 W-/FG##Aq"- . H4 W-/FG##Aq"-K . H K 02LM
2 N
2%, ((8 )8 ((. ). ((6 )6
 13KLO MO 13KLE ME
-
; ""	O #	O ""	O #	O 13KL""; # M; 13KL""; # M;40 	24MNI OI 
35OP? Q?
 
35OP> Q>@15 13NO!( P!(F 79Z[j13NOX.0HI> J P \> Y/1JKW-/FG  "E # H LE4 35ij_57TU V k  **75-+H+JL&11'%AT2U2UW   (@A<>J> J &I &IP 5 5$ (?@-P& Q& 
* 
* J J2 __W__&BCG+->? @ D [1CE;E;2H$<$<$ \24LM0 N0 ##"")G # $)GrJ   r   c                     a  ] tR tRt o ^ t]R 4       t]R 4       t]P                  ! ]
P                  ]
P                  9   R4      R 4       t]P                  ! ]
P                  ]
P                  9   R4      R 4       t]P                  ! ]! ]
R4      ;'       d    ]
P"                  ]
P                  9   R	4      ]P$                  ! ]P(                  R
4      R 4       4       t]P                  ! ]
P,                  ]
P                  9   R4      R 4       t]P                  ! ]
P0                  ]
P                  9   R4      R 4       t]P$                  ! ]P4                  R4      ]P                  ! ]! ]
R4      ;'       d    ]
P6                  ]
P                  9   R4      R 4       4       t]P                  ! ]
P:                  ]
P                  9   R4      R 4       t]P                  ! ]! ]
R4      ;'       d+    ]
P>                  ]
P                  9   ;'       d
    ]! ]R4      R4      R 4       t ]P                  ! ]
PB                  ]
P                  9   R4      R 4       t"]P                  ! ]! ]
R4      ;'       d    ]
PF                  ]
P                  9   R4      R 4       t$]P                  ! ]
PJ                  ]
P                  9   R4      R  4       t&]P                  ! ]
PN                  ]
P                  9   R!4      R" 4       t(]P                  ! ]
PR                  ]
P                  9   R#4      R$ 4       t*]P                  ! ]! ]
R%4      ;'       d    ]
PV                  ]
P                  9   R&4      R' 4       t,R(t-V t.R)# )*TestPosixDirFdi#  c              #    "   \         ;P                  ^,          un        \        P                   RV P                   2p\        P                   RV P                   R2p\        P
                  ! V4       V P                  \        P                  V4       \        P                  P                  W!4      p\        P                  ! V4      ;_uu_ 4       pWAV3x  RRR4       R#   + '       g   i     R# ; i5i)rS   _baseN)rC  countr   r   r   r$  r   r%  rl   r   r  open_dir_fd)r#   r;   base_dirfullnamer  s   &    r   prepareTestPosixDirFd.prepare&  s     !""#1TZZL1&&'qD9HX.77<</""8,,** -,,,s   CC7C#
C7#C4	.	C7c              #     "   V P                  4       ;_uu_ 4       w  rp\        P                  ! V4       V P                  \        P
                  V4       WV3x  R R R 4       R #   + '       g   i     R # ; i5irx   )rK  r   r  r   r   r   r#   r  r;   rJ  s   &   r   prepare_fileTestPosixDirFd.prepare_file2  sM     \\^^7h''1OOELL(3** ^^^s   A9A A%
A9%A6	0	A9z)test needs dir_fd support for os.access()c           
         V P                  4       ;_uu_ 4       w  rpV P                  \        P                  ! V\        P
                  VR 7      4       RRR4       R#   + '       g   i     R# ; ir  N)rO  ry   r   r  rl   r  rN  s   &   r   test_access_dir_fd!TestPosixDirFd.test_access_dir_fd9  sD      $<V8OOELLrwwvFG !   s   :AA.	z'test needs dir_fd support in os.chmod()c                   V P                  4       ;_uu_ 4       w  rp\        P                  ! V\        P                  4       \        P                  ! V\        P                  \        P
                  ,          VR 7       \        P                  ! V4      pV P                  VP                  \        P                  ,          \        P                  \        P
                  ,          4       RRR4       R#   + '       g   i     R# ; irR  )	rO  r   r  rz  r  r  rC   r  S_IRWXU)r#   r  r;   rJ  ss   &    r   test_chmod_dir_fd TestPosixDirFd.test_chmod_dir_fd>  s      $<V8KK$,,/KKdllT\\9&I

8$AQYY5!\\DLL8:	 !   s   CC22D	r  z'test needs dir_fd support in os.chown()r  c           	         V P                  4       ;_uu_ 4       w  rp\        P                  ! V\        P                  ! 4       \        P
                  ! 4       VR 7       RRR4       R#   + '       g   i     R# ; irR  )rO  r   r  rl   r4   r/   rN  s   &   r   test_chown_dir_fd TestPosixDirFd.test_chown_dir_fdG  sG       $<V8KKbiik299;vF !   s   AA''A8	z&test needs dir_fd support in os.stat()c                   V P                  4       ;_uu_ 4       w  rp\        VR 4      ;_uu_ 4       pVP                  R4       RRR4       V P                  \        P
                  V4       \        P                  ! V4      p\        P                  ! W!R7      pV P                  WV4       \        P                  ! VRR7      pV P                  WV4       V P                  \        R\        P                  V\        P                  ! 4       R7       V P                  \        R\        P                  V\        V4      R7       V P                  \        \        P                  VRR7       R F  pV P                  \        R4      ;_uu_ 4       pV P                  \         4      ;_uu_ 4        \        P                  ! RVR7       RRR4       RRR4       V P                  XP"                  \$        4       K  	  RRR4       R#   + '       g   i     EL; i  + '       g   i     LZ; i  + '       g   i     Le; i  + '       g   i     R# ; i)	r   z	testline
NrS  zshould be integer or None, notz!bool is used as a file descriptornonexistingl      Fx:^V )FT)rK  r   r   r   r   r   rz  rC   rS  r9   r(   r{  r8   r  assertWarnsRegexr!   r   filename__file__)	r#   r  r;   rJ  outfiles1s2r   r   s	   &        r   test_stat_dir_fdTestPosixDirFd.test_stat_dir_fdN  s   \\^^7hh$$l+ %OOELL(3H%BD0BR$HT2BR$""9.NJJU\\^ # =""9.NJJU6] # <mJJV  5 "**>;= =@B**733

=< 4=   h7 "% ^$$$( 43= =' ^^sS   H7G=	EH7H$&H?H$,H7=H	H7H!H$$H4/H77I	z'test needs dir_fd support in os.utime()c                   V P                  4       ;_uu_ 4       w  rp\        P                  ! 4       p\        P                  ! VR VR7       \        P                  ! W!R7       V P	                  \
        \        P                  VWAR7       V P	                  \
        \        P                  VRVR7       V P	                  \
        \        P                  VVR 3VR7       V P	                  \
        \        P                  VR V3VR7       V P	                  \
        \        P                  VVR3VR7       \        P                  ! V\        V4      \        V4      3VR7       \        P                  ! W$V3VR7       \        P                  ! V\        V4      \        V\        V4      ,
          R,          4      3VR7       \        P                  ! W!\        V4      \        V\        V4      ,
          R,          4      3R7       \        P                  \        P                  9   d    \        P                  ! VRVR7       R R R 4       R #   \         d     Li ; i  + '       g   i     R # ; i)NrS  r  r'  )r  r+   F)r2  r  r(  )
rO  r)  r   r*  r8   r9   r+  rl   r$  r,  )r#   r  r;   rJ  r-  s   &    r   test_utime_dir_fd TestPosixDirFd.test_utime_dir_fdi  s     $<V8))+CKKd62KK,id!  2id*6  ;id"Dk&  :id#Sk&  :id"Cj  9KKs3xS26BKKCj8KKXsC#c(Nc#9:;FLKK#&s8S#C.C1G-H"IK xx2666KKeFK1 ! 2 " 3 !  s*   HI!IIIIII&	z5WASI: symlink following on path_link is not supportedr:  z&test needs dir_fd support in os.link()c                F   V P                  4       ;_uu_ 4       w  rpV P                  4       ;_uu_ 4       w  rEp \        P                  ! W%WR 7       V P                  \        P                  V4       V P                  \        P                  ! V4      ^,          \        P                  ! V4      ^,          4       RRR4       RRR4       R#   \         d#   pT P                  RT,          4        Rp?LRp?ii ; i  + '       g   i     LJ; i  + '       g   i     R# ; i)
src_dir_fd
dst_dir_fdzposix.link(): %sN)
rO  rK  r   r:  r  r   r   r   rC   rz  )r#   r  r;   rJ  dir_fd2linknamefulllinknamer   s   &       r   test_link_dir_fdTestPosixDirFd.test_link_dir_fd  s       $<V8\\^^@<6

4fQ OOELL,7UZZ1!4

<(+-  !  # 6014556 ^ !  sL   DC<	CA(C<	:DC9C4/C<	4C99C<	<DDD 	z'test needs dir_fd support in os.mkdir()c                   V P                  4       ;_uu_ 4       w  rp\        P                  ! W!R 7       V P                  \        P                  V4       \        P
                  ! V4       RRR4       R#   + '       g   i     R# ; irR  )rK  r   r$  r   r%  rz  rN  s   &   r   test_mkdir_dir_fd TestPosixDirFd.test_mkdir_dir_fd  sJ    \\^^7hKK,OOEKK2JJx  ^^^s   AA44B	r  r  zAtest requires both stat.S_IFIFO and dir_fd support for os.mknod()c           	        V P                  4       ;_uu_ 4       w  rp\        P                  \        P                  ,          \        P                  ,          p \
        P                  ! W$^ VR7       V P                  \
        P                  V4       V P                  \        P                  ! \
        P                  ! V4      P                  4      4       RRR4       R#   \         dT   pT P                  TP                  \        P                  \        P                   \        P"                  34        Rp?LcRp?ii ; i  + '       g   i     R# ; i)r   rS  N)rK  rz  r  r  r  r   r  r   r   ry   r  r  r   r  r   rs   r   r  )r#   r  r;   rJ  r  r   s   &     r   test_mknod_dir_fd TestPosixDirFd.test_mknod_dir_fd  s     \\^^7h<<$,,.=DMD&9 h7ejj.B.J.J KL ^  R aggU\\5<<'PQQR	 ^^s7   >D?C1A#D?D<)A	D72D?7D<<D??E	z&test needs dir_fd support in os.open()c           	     >   V P                  4       ;_uu_ 4       w  rp\        VR 4      ;_uu_ 4       pVP                  R4       RRR4       V P                  \        P
                  V4       \        P                  ! V\        P                  VR7      p \        P                  ! V^	4      pV P                  RV4       \        P                  ! V4        RRR4       R#   + '       g   i     L; i  \        P                  ! T4       i ; i  + '       g   i     R# ; i)r   s	   testline
NrS  )
rK  r   r   r   r   r   r   r   rC   r   )r#   r  r;   rJ  rc  r   r   s   &      r   test_open_dir_fdTestPosixDirFd.test_open_dir_fd  s    \\^^7hh%%m, &OOELL(3D%..@B jjQ'  4B ^%% B ^^s;   DC	AD)C0<DC-(D0DDD	readlinkz*test needs dir_fd support in os.readlink()c           	     2   V P                  4       ;_uu_ 4       w  rp\        P                  ! R V4       V P                  \        P
                  V4       V P                  \        P                  ! W!R7      R 4       RRR4       R#   + '       g   i     R# ; ir  rS  N)rK  rl   r  r   r   r   rC   r}  rN  s   &   r   test_readlink_dir_fd#TestPosixDirFd.test_readlink_dir_fd  s[     \\^^7hJJy(+OOELL(3U^^D@)L ^^^   A"BB	z(test needs dir_fd support in os.rename()c                l   V P                  4       ;_uu_ 4       w  rpV P                  4       ;_uu_ 4       w  rEp\        P                  ! W%WR 7       \        P                  ! V4       \        P                  ! Wc4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)rl  N)rO  rK  r   r  rz  )r#   r  r;   rJ  ro  name2	fullname2s   &      r   test_rename_dir_fd!TestPosixDirFd.test_rename_dir_fd  ss      $<V8\\^^:	LL$*@JJy!LL-	  ! ^ !  s#   B"AB	=B"BB""B3	z)test needs dir_fd support in os.symlink()c                2   V P                  4       ;_uu_ 4       w  rp\        P                  ! R W!R7       V P                  \        P                  V4       V P                  \        P                  ! V4      R 4       RRR4       R#   + '       g   i     R# ; ir  )rK  r   r  r   r   rC   r}  rN  s   &   r   test_symlink_dir_fd"TestPosixDirFd.test_symlink_dir_fd  sY    \\^^7hMM)T9OOELL(3U^^H5yA ^^^r  z(test needs dir_fd support in os.unlink()c                   V P                  4       ;_uu_ 4       w  rp\        P                  ! V4       \        P                  ! V4        \        P
                  ! W!R 7       V P                  \        \        P                  V4        RRR4       R#    T P                  \        P
                  T4       h ; i  + '       g   i     R# ; irR  )	rK  r   r  r   rz  r   r8   r   r   rN  s   &   r   test_unlink_dir_fd!TestPosixDirFd.test_unlink_dir_fd  s    \\^^7h''1JJx T1!!'5::x@ ^h7 ^^s   0B7
<B#B44B77C	r  z(test needs dir_fd support in os.mkfifo()c           	        V P                  4       ;_uu_ 4       w  rp \        P                  ! V\        P                  \        P
                  ,          VR 7       V P                  \        P                  V4       V P                  \        P                  ! \        P                  ! V4      P                  4      4       RRR4       R#   \         d#   pT P                  RT,          4        Rp?LRp?ii ; i  + '       g   i     R# ; i)rS  r  N)rK  r   r  rz  r  r  r  r   r   r   ry   r  r  )r#   r  r;   rJ  r   s   &    r   test_mkfifo_dir_fd!TestPosixDirFd.test_mkfifo_dir_fd  s    \\^^7h8T4<<$,,#>vN OOELL(3OODMM%**X*>*F*FGH ^ # 82Q6778 ^^s5   C7<CA#C7C4C/*C7/C44C77D	r   N)/r*  r+  r,  r-  rG  r	   rK  rO  rp   r.  rl   r  supports_dir_fdrT  r  rY  r   r  r2  r   r  r\  rz  rf  r*  ri  r3  r:  rr  r$  ru  r  rx  r   r{  r}  r  r  r  r  r  r   r  r  r  r>  r?  r@  s   @r   rC  rC  #  s    E	+ 	+ + + b&8&88:efH gH R%7%779bc: d: W-RR288r?Q?Q3QBD__W**,@AG BDG B$6$668`a8 b84 R%7%779bc d< __? F==2+=+= =0
-		
- R%7%779bc! d! W- 6 6 hh"*<*<<6 6$T95\^M	^M B$6$668`a
  b
  Z0XXbkkREWEW6WEGMGM b&8&88:de. f. r'9'99;fgB hB b&8&88:de	 f	 X.RR299@R@R3RT~I @IrJ   rC  c                      a  ] tR tRt o R tR t]P                  ! ]! ]	R4      R4      R 4       t
]P                  ! ]! ]	R4      R4      R	 4       tR
tV tR# )PosixGroupsTesteri  c                H   \         P                  ! 4       ^ 8w  d   \        P                  ! R4      h\	        \         R4      '       g   \        P                  ! R4      h\
        P                  R8X  d   \        P                  ! R4      h\         P                  ! 4       V n        R# )r   znot enough privilegesr0   zneed posix.getgroupsr  zgetgroups(2) is broken on OSXN)	r   r4   rp   rq   r   r   r  r0   saved_groupsr"   s   &r   r$   PosixGroupsTester.setUp  sn    <<>Q##$;<<uk**##$:;;<<8###$CDD!OO-rJ   c                Z   \        \        R 4      '       d#   \        P                  ! V P                  4       R# \        \        R4      '       d]   \        P
                  ! \        P                  ! 4       4      P                  p\        P                  ! WP                  ^ ,          4       R# R# )	setgroupsrg   N)	r   r   r  r  rm   rh   r4   rn   rg   r#   r;   s   & r   tearDownPosixGroupsTester.tearDown  sf    5+&&OOD--.UL))<</77DT#4#4Q#78 *rJ   rg   ztest needs posix.initgroups()c                0   \        V P                  ;'       g    ^ .4      ^,           p\        P                  ! \        P
                  ! 4       4      P                  p\        P                  ! W!4       V P                  V\        P                  ! 4       4       R# r  )
maxr  rm   rh   r   r4   rn   rg   r  r0   )r#   r  r;   s   &  r   rt   !PosixGroupsTester.test_initgroups  s`    
 !!((aS)A-||ELLN+33!a*+rJ   r  ztest needs posix.setgroups()c                    ^ .\        \        ^4      4      3 F>  p\        P                  ! V4       V P	                  V\        P
                  ! 4       4       K@  	  R# r  )r   r  r   r  assertListEqualr0   )r#   r  s   & r   test_setgroups PosixGroupsTester.test_setgroups  s@     sDrO,FOOF#  ):; -rJ   )r  N)r*  r+  r,  r-  r$   r  rp   r.  r   r   rt   r  r>  r?  r@  s   @r   r  r    se     .9 58:,:, 479<9<rJ   r  c                     a  ] tR tRt o ]P
                  RRRR3tRtR tR t	R	 t
R
 tR tR tR tR tR tR t]P&                  ! ]! ]R4      R4      R 4       tR tR t]P&                  ! ]! ]R4      R4      R 4       tR t]]P8                  ! ]P:                  P=                  R!4      R4      R 4       4       t]]P8                  ! ]P:                  P=                  R!4      R4      R 4       4       t R t!R t"R t#R t$R t%R t&V t'R# )"_PosixSpawnMixini  -I-Sr   r   Nc                .    \         P                  R R.VO5# )r  r  )r   r   r#   argss   &*r   python_args_PosixSpawnMixin.python_args  s     d2T22rJ   c                   \         P                  pV P                  \         P                  V4       R V: R2pV P	                  RV4      pV P                  V^ ,          V\        P                  4      p\        P                  ! V^ R7       \        VRR7      ;_uu_ 4       pV P                  VP                  4       \        V4      4       RRR4       R#   + '       g   i     R# ; i)2if 1:
            import os
            with open(zO, "w") as pidfile:
                pidfile.write(str(os.getpid()))
            r   r   utf-8encodingN)r   r   r   r   r  
spawn_funcrl   r   r   r   r   rC   r   r  )r#   pidfilescriptr  r   r  s   &     r   test_returns_pid!_PosixSpawnMixin.test_returns_pid#  s    ""	(('2k "
 f-ood1gtRZZ8S1-'G,,QVVXs3x0 -,,,s   *CC$	c                >   R p V P                  VV.\        P                  4      p\        P                  ! V^ 4      w  r4V P	                  W24       V P                  V^ 4       R#   \        \        3 d(   pT P	                  TP                  T4        Rp?R# Rp?ii ; i)no_such_executableN)	r  rl   r   waitpidrC   r  FileNotFoundErrorr  ra  )r#   r  r   pid2statusexcs   &     r   test_no_such_executable(_PosixSpawnMixin.test_no_such_executable1  s    1	+//"4#5"6"$**.C ::c1-LDT'* "?3 	?S\\+=>>	?s   "A$ $B5BBc                   \         P                  pV P                  \         P                  V4       R V: R2pV P	                  RV4      pV P                  V^ ,          V/ \        P                  CRR/C4      p\        P                  ! V^ R7       \        VRR7      ;_uu_ 4       pV P                  VP                  4       R4       RRR4       R#   + '       g   i     R# ; i)	r  z^, "w", encoding="utf-8") as envfile:
                envfile.write(os.environ['foo'])
        r   rj   barr   r  r  N)r   r   r   r   r  r  rl   r   r   r   r   rC   r   )r#   envfiler  r  r   r  s   &     r   test_specify_environment)_PosixSpawnMixin.test_specify_environment@  s    ""	(('2k "	
 f-ood1gt::UE:<S1-'G,,QVVXu- -,,,s   %!CC!	c                    V P                  V P                  ^ ,          V P                  \        P                  RR7      p\        P
                  ! V^ R7       R# )r   Nfile_actionsr   r  NOOP_PROGRAMrl   r   r   r   r#   r   s   & r   test_none_file_actions'_PosixSpawnMixin.test_none_file_actionsO  sH    ooa JJ	  
 	S1-rJ   c                    V P                  V P                  ^ ,          V P                  \        P                  . R7      p\        P
                  ! V^ R7       R# )r   r  r   Nr  r  s   & r   test_empty_file_actions(_PosixSpawnMixin.test_empty_file_actionsX  sH    ooa JJ	  
 	S1-rJ   c                    V P                  \        P                  \        P                  R R.\        P                  RR7      p\
        P                  ! V^ R7       R# )r   r   Fresetidsr   Nr  r   r   rl   r   r   r   r  s   & r   test_resetids_explicit_default/_PosixSpawnMixin.test_resetids_explicit_defaulta  sF    ooNN^^T6*JJ	  
 	S1-rJ   c                    V P                  \        P                  \        P                  R R.\        P                  RR7      p\
        P                  ! V^ R7       R# )r   r   Tr  r   Nr  r  s   & r   test_resetids_PosixSpawnMixin.test_resetidsj  sF    ooNN^^T6*JJ	  
 	S1-rJ   c                    V P                  \        P                  \        P                  R R.\        P                  \        P
                  ! 4       R7      p\        P                  ! V^ R7       R# )r   r   	setpgroupr   N)r  r   r   rl   r   r2   r   r   r  s   & r   test_setpgroup_PosixSpawnMixin.test_setpgroups  sL    ooNN^^T6*JJjjl	  
 	S1-rJ   c           	         V P                  \        4      ;_uu_ 4        V P                  \        P                  \        P                  R R.\
        P                  RR7       RRR4       R#   + '       g   i     R# ; i)r   r   023r  N)r8   r9   r  r   r   rl   r   r"   s   &r   test_setpgroup_wrong_type*_PosixSpawnMixin.test_setpgroup_wrong_type|  sP    y))OOCNN ^^T6:JJ%  9 *)))s   AA++A<	pthread_sigmaskzneed signal.pthread_sigmask()c                   \         P                  ! R 4      pV P                  \        P                  \        P                  RV.\
        P                  \        P                  .R7      p\        P                  ! V^ R7       R# )I            import signal
            signal.raise_signal(signal.SIGUSR1)r   
setsigmaskr   N)textwrapdedentr  r   r   rl   r   r9  SIGUSR1r   r   )r#   r   r   s   &  r   test_setsigmask _PosixSpawnMixin.test_setsigmask  sd       3 4 ooNN^^T4(JJ'	  
 	S1-rJ   c           
     8   V P                  \        4      ;_uu_ 4        V P                  \        P                  \        P                  R R.\
        P                  ^"R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  \        P                  \        P                  R R.\
        P                  R.R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  \        P                  \        P                  R R.\
        P                  \        P                  \        P                  ^,           .R7       RRR4       R#   + '       g   i     EL	; i  + '       g   i     L; i  + '       g   i     R# ; i)r   r   r  Nj
r8   r9   r  r   r   rl   r   r,  r9  NSIGr"   s   &r   test_setsigmask_wrong_type+_PosixSpawnMixin.test_setsigmask_wrong_type  s   y))OOCNN ^^T6:JJ2  7 * y))OOCNN ^^T6:JJC5  : * z**OOCNN ^^T6:JJFKK4:KKM4C  D +* *)) *) +**&   AE!AE5/A(F!E2	5F	F	c                R   \         P                  ! 4       w  rV P                  \         P                  V4        \         P                  ! VR 4       \
        P                  ! RV R24      p V P                  \        P                  \        P                  RV.\         P                  R R7      p\         P                  ! V4       \        P                  ! X^ R7       \         P                   ! V^d4      p\#        V4      p\         P$                  ! \         P&                  ! 4       4      pV P)                  W4       R#   \         d    pT P                  RT: 24        Rp?LRp?i\         d    pT P                  RT: 24        Rp?LRp?ii ; i  \         P                  ! T4       i ; i)	Tz0
                import os
                fd = z`
                sid = os.getsid(0)
                os.write(fd, str(sid).encode())
            r   )setsidzsetsid is not supported: Nzsetsid failed with: r   )rl   r  r   r   set_inheritabler  r  r  r   r   r   r   r   r  r   r   r   r+  getsidr1   r  )	r#   rfdwfdr   r   r  output	child_sid
parent_sids	   &        r   test_setsid_PosixSpawnMixin.test_setsid  s=   779#&	sD)?? (U $ D>oocnn'*~~tT&B&(jj & ? HHSMS1-c"K	YYryy{+
J2 ' C 9#ABB" > 4SG<==> HHSMsH   1F +AD9 9FEF F+F,FF FF F&c                (   \         P                   ! \         P                  \         P                  4      p\        P                  ! R 4      p V P                  \        P                  \        P                  RV.\        P                  \         P                  .R7      p\         P                   ! \         P                  V4       \        P                  ! V\         P                  ) R7       R#   \         P                   ! \         P                  T4       i ; i)r  r   	setsigdefr   N)r9  r  SIG_IGNr  r  r  r   r   rl   r   r   r   )r#   original_handlerr   r   s   &   r   test_setsigdef_PosixSpawnMixin.test_setsigdef  s     "==H  3 4	<//t,

!>>*	 " C MM&..*:;SFNN?; MM&..*:;s   AC* *'Dc           
     8   V P                  \        4      ;_uu_ 4        V P                  \        P                  \        P                  R R.\
        P                  ^"R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  \        P                  \        P                  R R.\
        P                  R.R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  \        P                  \        P                  R R.\
        P                  \        P                  \        P                  ^,           .R7       RRR4       R#   + '       g   i     EL	; i  + '       g   i     L; i  + '       g   i     R# ; i)r   r   r  Nr  r  r"   s   &r   test_setsigdef_wrong_type*_PosixSpawnMixin.test_setsigdef_wrong_type  s
   y))OOCNN ^^T6:JJ"  6 * y))OOCNN ^^T6:JJ3%  9 * z**OOCNN ^^T6:JJ6;;A2N  P +* *)) *) +**r  zbpo-34685: test can fail on BSDc           	     x   \         P                  ! ^ 4      p\         P                  ! V4      p\        P                  ! RV RV R24      pV P                  \        P                  \        P                  RV.\         P                  R\         P                  ! V4      3R7      p\        P                  ! V^ R7       R# )r   F            import os, sys
            if os.sched_getscheduler(0) != V:
                sys.exit(101)
            if os.sched_getparam(0).sched_priority != :
                sys.exit(102)r   N	schedulerr   rl   r   r  r  r  r  r   r   r   r  r   r   r#   policypriorityr   r   s   &    r   test_setscheduler_only_param-_PosixSpawnMixin.test_setscheduler_only_param  s     &&q),,V4 $,,28 477?j A	 ! " ooNN^^T4(JJR^^H56	  
 	S1-rJ   c           	     x   \         P                  ! ^ 4      p\         P                  ! V4      p\        P                  ! RV RV R24      pV P                  \        P                  \        P                  RV.\         P                  V\         P                  ! V4      3R7      p\        P                  ! V^ R7       R# )r   r  r	  r
  r   r  r   Nr  r  s   &    r   test_setscheduler_with_policy._PosixSpawnMixin.test_setscheduler_with_policy  s     &&q),,V4 $,,28 477?j A	 ! " ooNN^^T4(JJr~~h78	  
 	S1-rJ   c                   \         P                  ^\         P                  P                  \        4      \         P
                  ^ 3\         P                  ^ 3\         P                  ^^3.pV P                  V P                  ^ ,          V P                  \         P                  VR7      p\        P                  ! V^ R7       R# )rB   r  r   N)rl   POSIX_SPAWN_OPENr   realpathrb  r   POSIX_SPAWN_CLOSEPOSIX_SPAWN_DUP2r  r  r   r   r   )r#   r  r   s   &  r   test_multiple_file_actions+_PosixSpawnMixin.test_multiple_file_actions  s      !RWW%5%5h%?aP!!1%  !Q'

 ood//2"// jj+7  9 	S1-rJ   c                &   V P                   pV P                  \        4      ;_uu_ 4        V P                  V^ ,          V\        P
                  R.R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  V^ ,          V\        P
                  R.R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  V^ ,          V\        P
                  R.R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  V^ ,          V\        P
                  R.R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  V^ ,          V\        P
                  \        P                  3.R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  V^ ,          V\        P
                  \        P                  ^^3.R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  V^ ,          V\        P
                  \        P                  R3.R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  V^ ,          V\        P
                  \        P                  ^\        R,           \        P                  ^ 3.R7       RRR4       R#   + '       g   i     EL; i  + '       g   i     ELi; i  + '       g   i     EL,; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELU; i  + '       g   i     EL; i  + '       g   i     R# ; i)r   Nr  r  r   rx   )i90  )r  r8   r9   r  rl   r   r  r,  r  rb  r   r  s   & r   test_bad_file_actions&_PosixSpawnMixin.test_bad_file_actions  s     y))OODGT2::*.  1 * y))OODGT2::*,  / * y))OODGT2::*1  4 * y))OODGT2::*2  5 * y))OODGT2::+-+?+?*A)B  D * y))OODGT2::+-+?+?A*F)G  I * y))OODGT2::+-+?+?*F)G  I * z**OODGT2::+-+>+>+,ho+-;;+; *<  = +*+ *)) *)) *)) *)) *)) *)) *)) +**s`   ,K3;,L,L,L/.;M=M0<M+AM?3L	L	L,	/M 	M	M(	+M<	?N	c                   \         P                  pV P                  \         P                  V4       R p\        P
                  ^V\        P                  \        P                  ,          \        P                  ,          \        P                  \        P                  ,          3.pV P                  RV4      pV P                  V^ ,          V\        P                  VR7      p\        P                   ! V^ R7       \#        VRR7      ;_uu_ 4       pV P%                  VP'                  4       R4       RRR4       R#   + '       g   i     R# ; i)Oif 1:
            import sys
            sys.stdout.write("hello")
            r   r  r   r  r  helloN)r   r   r   r   rl   r  r   r   O_TRUNCrz  r  r  r  r  r   r   r   r   rC   r   )r#   rc  r  r  r  r   r  s   &      r   test_open_file_PosixSpawnMixin.test_open_file1  s    ""	(('2
   !Wbjj(2::5t||+-

 f-ood1gtRZZ+7  9 	S1-'G,,QVVXw/ -,,,s   !D88E		c                   \         P                  pV P                  \         P                  V4       R V: R2pV P	                  RV4      pV P                  V^ ,          V\        P                  \        P                  ^ 3.R7      p\        P                  ! V^ R7       \        VRR7      ;_uu_ 4       pV P                  VP                  4       R\        P                  ,          4       RRR4       R#   + '       g   i     R# ; i)	zif 1:
            import os
            try:
                os.fstat(0)
            except OSError as e:
                with open(zq, 'w', encoding='utf-8') as closefile:
                    closefile.write('is closed %d' % e.errno)
            r   r  r   r  r  zis closed %dN)r   r   r   r   r  r  rl   r   r  r   r   r   rC   r   r   r  )r#   	closefiler  r  r   r  s   &     r   test_close_file _PosixSpawnMixin.test_close_fileE  s    $$		(()4
 %- ( f-ood1gtRZZ-/-A-A1,E+F  H 	S1-)g..!QVVX~'CD /...s   26C22D	c           	     Z   \         P                  pV P                  \         P                  V4       R p\	        VR4      ;_uu_ 4       p\
        P                  VP                  4       ^3.pV P                  RV4      pV P                  V^ ,          V\
        P                  VR7      p\        P                  ! V^ R7       RRR4       \	        VRR7      ;_uu_ 4       pV P                  VP                  4       R4       RRR4       R#   + '       g   i     LP; i  + '       g   i     R# ; i)	r!  r   r   r  r   Nr  r  r"  )r   r   r   r   r   rl   r  r   r  r  r   r   r   rC   r   )r#   dupfiler  	childfiler  r  r   r  s   &       r   rd  _PosixSpawnMixin.test_dup2X  s    ""	(('2 '4  I$$i&6&6&8!<L ##D&1D//$q'4/; " =C  q1 ! 'G,,QVVXw/ -, !  -,,s   A7D!DD	D*	r   r  )(r*  r+  r,  r-  r   r   r  r  r  r  r  r  r  r  r  r  r  r  rp   r.  r   r9  r  r  r  r  r  r<  r2  r  r  r  r  r  r  r$  r(  rd  r>  r?  r@  s   @r   r  r    sL    NND$f=LJ31+......9 ):;:<.<.D3> ):;8:<:<"P __S\\,,-BC68.8 ." __S\\,,-BC68.8 ."
.=:0(E&0 0rJ   r  posix_spawnztest needs os.posix_spawnc                   *    ] tR tRt]! ]RR4      tRtR# )TestPosixSpawnik  r.  Nr   )r*  r+  r,  r-  r6   r   r  r>  r   rJ   r   r0  r0  k  s     t4JrJ   r0  posix_spawnpztest needs os.posix_spawnpc                   X   a  ] tR tRt o ]! ]RR4      t]P                  R 4       t	Rt
V tR# )TestPosixSpawnPiq  r1  Nc                   \         P                  ! 4       pV P                  \        P                  V4       R p\
        P                  P                  W4      p\
        P                  ! \        P                  V4        \
        P                  P                  V\
        P                  R,          34      pVRRRR3p\        P                  ! RV: R24      pRV3p\!        VRV/  R#   \         d    Tp LBi ; i)	zposix_spawnp_test_program.exePATHr  r  r   r   zP
            import os
            from test import support

            args = zy
            pid = os.posix_spawnp(args[0], args, os.environ)

            support.wait_process(pid, exitcode=0)
        N)tempfilemkdtempr   r   r  rl   r   r  r  r   r   pathsepr   ro   r  r  r   )r#   temp_dirprogramprogram_fullpathr   
spawn_argsr   r  s   &       r   test_posix_spawnp!TestPosixSpawnP.test_posix_spawnpv  s     ##%	(((3177<<:


3>>#34	::??Hbjj.@#ABD tT48
    d|$*T*%  	D	s   =6C& &C65C6r   )r*  r+  r,  r-  r6   r   r  r   r8  r=  r>  r?  r@  s   @r   r3  r3  q  s-      5J""+ #+rJ   r3  r  ztest weak linking on macOSc                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tRtV tR# )TestPosixWeaklinkingi  c                   ^ RI p^ RIpVP                  4       pV Uu0 uF-  qDP                  R4      '       g   K  W4,          '       g   K+  VkK/  	  upV n        \
        ;QJ d@    . R VP                  ! 4       ^ ,          P                  R4       4       F  NK  	  5V n        R# ! R VP                  ! 4       ^ ,          P                  R4       4       4      V n        R# u upi )r   NHAVE_c              3   8   "   T F  p\        V4      x  K  	  R # 5irx   r  )r  parts   & r   r  -TestPosixWeaklinking.setUp.<locals>.<genexpr>  s     T3S4SYY3Sr  r  )r  r  get_config_varsr  	availabler  mac_verr   )r#   r  r  config_varsnms   &    r   r$   TestPosixWeaklinking.setUp  s    //1(3c"}}W7M2R]RaRa22cuT83C3C3Ea3H3N3Ns3STuuT83C3C3Ea3H3N3Ns3STT ds   CC
Cc                X    WP                   9  d   \        P                  ! V R 24      hR# )z not weak-linkedN)rG  rp   rq   r  s   &&r   _verify_available&TestPosixWeaklinking._verify_available  s*    ~~%##tf,<$=>> &rJ   c                    V P                  R 4       V P                  R8  d/   V P                  \        R4       V P                  \        R4       R# V P	                  \        R4       V P	                  \        R4       R# )HAVE_PWRITEVr   r   N)r     )rM  rH  rV  rl   assertNotHasAttrr"   s   &r   r   !TestPosixWeaklinking.test_pwritev  s^    ~.<<8#r9-r8, !!"i0!!"h/rJ   c                t   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_FSTATATdir_fd unavailablefilerS  Nr  r  )
rM  rH  r  r   _have_functionsassertNotInrS  r   rl   rz  r"   s   &r   r  TestPosixWeaklinking.test_stat  s{    ~.<<8#MM.%*?*?@ ^U-B-BC''(;=QRRq) SRRR   B&&B7	c                    V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       R# )HAVE_PTSNAME_RN)r        )rM  rH  r  r   rY  rZ  r"   s   &r   test_ptsname_r#TestPosixWeaklinking.test_ptsname_r  sI    /0<<;&MM*E,A,AB-u/D/DErJ   c                   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R\        P                  ^ R7       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! R\        P                  RR7       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! R\        P                  R	R
7       RRR4       R#   + '       g   i     L; i  + '       g   i     Ls; i  + '       g   i     R# ; i)HAVE_FACCESSATrV  rW  rS  Nzfollow_symlinks unavailableFr1  zeffective_ids unavailableT)effective_idsrX  )rM  rH  r  r   rY  rZ  rS  r   rl   r  r  r"   s   &r   r   TestPosixWeaklinking.test_access  s    /0<<8#MM*E,A,AB -u/D/DE''(;=QRR		&"''!4 S ''(;=Z[[		&"''5A \ ''(;=XYY		&"''> ZY SR \[ ZYYs$   (E(E$(E7E!	$E4	7F	c                   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  R\        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! RR^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_FCHMODATHAVE_LCHMODrV  rW  i  rS  NrX  )
rM  rH  r  r   rY  rZ  rS  r   rl   r  r"   s   &r   
test_chmodTestPosixWeaklinking.test_chmod  s    /<<8#MM/5+@+@A _e.C.CDMM-)>)>?''(;=QRRq1 SRRRs   #CC	c           	        V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  R\        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R^ ^ ^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_FCHOWNATHAVE_LCHOWNrV  rW  rS  NrX  )
rM  rH  r  r   rY  rZ  rS  r   rl   r  r"   s   &r   r  TestPosixWeaklinking.test_chown  s    /<<8#MM/5+@+@A _e.C.CDMM-)>)>?''(;=QRRAa0 SRRRs   #CC	c           
        V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! RR^ R7       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! RR^ R7       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! RR^ ^ R7       RRR4       \        P                  ! 4       ;_uu_ 4       p\        P                  P                  VR	4      p\        P                  P                  VR4      p\        P                  P                  VR4      p\        VR
4      ;_uu_ 4       pVP                  R4       RRR4       \        P                   ! RV4       V P#                  \$        4      ;_uu_ 4        \        P                  ! WBRR7       RRR4       V P#                  \$        4      ;_uu_ 4        \        P                  ! WBRR7       RRR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L|; i  + '       g   i     R# ; i)HAVE_LINKATzsrc_dir_fd unavailablesourcer  rm  Nzdst_dir_fd unavailablern  rl  r:  r   dataTr1  FrX  )rM  rH  r  r   rY  rZ  rS  r   rl   r:  r   r9  r   r  r   r   r  r8   FileExistsError)r#   r  	link_pathtarget_pathsource_pathr   s   &     r   	test_linkTestPosixWeaklinking.test_link  s   }-<<8#MM-)>)>? ]E,A,AB''(;=UVV(: W ''(;=UVV(: W ''(;=UVV(aH W ##%%GGLLF;	 ggll9h? ggll9h?+s++rHHV$ , 

8Y/ &&77GGKDI 8 &&77GGKEJ 8# &% WVV WVV WVV ,+ 87 87# &%%sy   I/JJA5K$8J+	
<K$J>	%K$K	K$/J 	J	J(	+J;6K$>K	K$K!K$$K5	c                   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! ^ 4       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! ^ 4       RRR4       R#   + '       g   i     LO; i  + '       g   i     R# ; i)HAVE_FDOPENDIRzClistdir: path should be string, bytes, os.PathLike or None, not intNzCscandir: path should be string, bytes, os.PathLike or None, not intrX  )rM  rH  r  r   rY  rZ  rS  r9   rl   r  scandirr"   s   &r   test_listdir_scandir)TestPosixWeaklinking.test_listdir_scandir	  s    /0<<8#MM*E,A,AB -u/D/DE''	3xyy

1 z ''	3xyy

1 zy zy zyys   C! C4!C1	4D	c                t   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_MKDIRATrV  dirrS  NrX  )
rM  rH  r  r   rY  rZ  rS  r   rl   r$  r"   s   &r   
test_mkdirTestPosixWeaklinking.test_mkdir$	  s{    ~.<<8#MM.%*?*?@ ^U-B-BC''(;=QRRq) SRRRr\  c                t   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_MKFIFOATrV  r   rS  Nr_  r   )
rM  rH  r  r   rY  rZ  rS  r   rl   r  r"   s   &r   r   TestPosixWeaklinking.test_mkfifo/	  s{    /<<7"MM/5+@+@A _e.C.CD''(;=QRR		&+ SRRRr\  c                t   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_MKNODATrV  r   rS  Nr  )
rM  rH  r  r   rY  rZ  rS  r   rl   r  r"   s   &r   r  TestPosixWeaklinking.test_mknod:	  s{    ~.<<7"MM.%*?*?@ ^U-B-BC''(;=QRR* SRRRr\  c                h   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! RR^ R7       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! RR^ R7       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! RR^ R7       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! RR^ R7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lx; i  + '       g   i     R# ; i)HAVE_RENAMEATz%src_dir_fd and dst_dir_fd unavailableabrs  Nrt  rX  )rM  rH  r  r   rY  rZ  rS  r   rl   r  r  r"   s   &r   test_rename_replace(TestPosixWeaklinking.test_rename_replaceE	  s(   /<<8#MM/5+@+@A _e.C.CD''(;=dee		#sq1 f ''(;=dee		#sq1 f ''(;=dee

32 f ''(;=dee

32 fe fe fe fe fees0   E'E:FF 'E7	:F
	F	 F1	c                   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R^ R7       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! R^ R7       RRR4       R#   + '       g   i     LQ; i  + '       g   i     R# ; i)HAVE_UNLINKATrV  r   rS  NrX  )rM  rH  r  r   rY  rZ  rS  r   rl   r   r%  r"   s   &r   test_unlink_rmdir&TestPosixWeaklinking.test_unlink_rmdirY	  s    /<<8#MM/5+@+@A _e.C.CD''(;=QRR		&+ S ''(;=QRR* SR SR SRRs   C%C8%C5	8D		c                   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R\        P                  ^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_OPENATrV  r   rS  NrX  )rM  rH  r  r   rY  rZ  rS  r   rl   r   r   r"   s   &r   	test_openTestPosixWeaklinking.test_openg	  s    }-<<8#MM-)>)>? ]E,A,AB''(;=QRRA6 SRRRs   (B55C	c                t   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_READLINKATrV  r   rS  NrX  )
rM  rH  r  r   rY  rZ  rS  r   rl   r}  r"   s   &r   test_readlink"TestPosixWeaklinking.test_readlinkr	  s~    01<<8#MM+U-B-BC .0E0EF''(;=QRRFA. SRRRr\  c                v   V P                  R 4       V P                  R8  d#   V P                  R \        P                  4       R# V P                  R \        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! RR^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_SYMLINKATrV  r  r  rS  NrX  )
rM  rH  r  r   rY  rZ  rS  r   rl   r  r"   s   &r   test_symlink!TestPosixWeaklinking.test_symlink}	  s    /0<<8#MM*E,A,AB -u/D/DE''(;=QRR

3Q/ SRRRs   B''B8	c                   V P                  R 4       V P                  R4       V P                  R8  dC   V P                  R \        P                  4       V P                  R\        P                  4       R# V P                  R \        P                  4       V P                  R\        P                  4       V P                  \        R4      ;_uu_ 4        \        P                  ! R^ R7       RRR4       R#   + '       g   i     R# ; i)HAVE_FUTIMENSHAVE_UTIMENSATrV  r   rS  N)r  r_  )
rM  rH  r  r   rY  rZ  rS  r   rl   r*  r"   s   &r   r  TestPosixWeaklinking.test_utime	  s    //0<<8#MM/5+@+@AMM*E,A,AB _e.C.CD-u/D/DE''(;=QRR* SRRRs   C77D	)rG  rH  N)r*  r+  r,  r-  r$   rM  r   r  ra  r  rj  r  rz  r  r  r  r  r  r  r  r  r  r  r>  r?  r@  s   @r   r@  r@    sm     U?0	*F?"
2
1$KN	*	,	+3(+	7	/	0+ +rJ   r@  c                   &  a  ] tR tRt o ]P
                  ! ]! ]R4      R4      ]P
                  ! ]! ]R4      R4      ]P
                  ! ]P                  P                  R4      R4      ]
P                  ! ^^ ^ 4      R 4       4       4       4       tR	tV tR
# )NamespacesTestsi	  unsharezneeds os.unshare()setnszneeds os.setns()z/proc/self/ns/utszneed /proc/self/ns/utsc                "    R p\        RV4       R# )a  if 1:
            import errno
            import os
            import sys
            fd = os.open('/proc/self/ns/uts', os.O_RDONLY)
            try:
                original = os.readlink('/proc/self/ns/uts')
                try:
                    os.unshare(os.CLONE_NEWUTS)
                except OSError as e:
                    if e.errno == errno.ENOSPC:
                        # skip test if limit is exceeded
                        sys.exit()
                    raise
                new = os.readlink('/proc/self/ns/uts')
                if original == new:
                    raise Exception('os.unshare failed')
                os.setns(fd, os.CLONE_NEWUTS)
                restored = os.readlink('/proc/self/ns/uts')
                if original != restored:
                    raise Exception('os.setns failed')
            except PermissionError:
                # The calling process did not have the required privileges
                # for this operation
                pass
            except OSError as e:
                # Skip the test on these errors:
                # - ENOSYS: syscall not available
                # - EINVAL: kernel was not configured with the CONFIG_UTS_NS option
                # - ENOMEM: not enough memory
                if e.errno not in (errno.ENOSYS, errno.EINVAL, errno.ENOMEM):
                    raise
            finally:
                os.close(fd)
            r   Nr   r   s   & r   test_unshare_setns"NamespacesTests.test_unshare_setns	  s    
"H 	t$rJ   r   N)r*  r+  r,  r-  rp   r.  r   rl   r   r  r   r4  r  r>  r?  r@  s   @r   r  r  	  s      Y/1EFW-/AB(;<>VW##Aq!,%% - X C G%%rJ   r  c                  0    \         P                  ! 4        R # rx   )r   reap_childrenr   rJ   r   tearDownModuler  	  s    rJ   __main__r  )5r   r   test.supportr   r   r   test.support.script_helperr   r  r   r   r9  r)  rl   r  r  rz  r6  rp   r   r  
contextlibr	   r   ImportErrorrD  rm   r   r  
gettempdirr   r  r.  maxsizer  r3  r1  r   r<  TestCaser   rC  r  r  r   r5  r0  r3  r@  r  r  r*  mainr   rJ   r   <module>r     sW    ! " ( 7   
   	        % h113'..1AAC ""KK%JJ!6!6!I!I'//J. $$_%68VWgG(## gGV/LIX&& LI^!<)) !<HR0 R0j
 
WR/1LM5X&&(8 5  N5 
WR02NO!+h'')9 !+  P!+H 
S\\X-/KL|+8,, |+ M|+~,%h'' ,%^ zMMO aM  
  
Cs$   I
 I 
II	I)(I)