@@ -795,43 +795,6 @@ def test_realpath_resolve_first(self, kwargs):
795795            safe_rmdir (ABSTFN  +  "/k" )
796796            safe_rmdir (ABSTFN )
797797
798-     @os_helper .skip_unless_symlink  
799-     @skip_if_ABSTFN_contains_backslash  
800-     @unittest .skipIf (os .chmod  not  in os .supports_follow_symlinks , "Can't set symlink permissions" ) 
801-     @unittest .skipIf (sys .platform  !=  "darwin" , "only macOS requires read permission to readlink()" ) 
802-     def  test_realpath_unreadable_symlink (self ):
803-         try :
804-             os .symlink (ABSTFN + "1" , ABSTFN )
805-             os .chmod (ABSTFN , 0o000 , follow_symlinks = False )
806-             self .assertEqual (realpath (ABSTFN ), ABSTFN )
807-             self .assertEqual (realpath (ABSTFN  +  '/foo' ), ABSTFN  +  '/foo' )
808-             self .assertEqual (realpath (ABSTFN  +  '/../foo' ), dirname (ABSTFN ) +  '/foo' )
809-             self .assertEqual (realpath (ABSTFN  +  '/foo/..' ), ABSTFN )
810-         finally :
811-             os .chmod (ABSTFN , 0o755 , follow_symlinks = False )
812-             os_helper .unlink (ABSTFN )
813- 
814-     @os_helper .skip_unless_symlink  
815-     @skip_if_ABSTFN_contains_backslash  
816-     @unittest .skipIf (os .chmod  not  in os .supports_follow_symlinks , "Can't set symlink permissions" ) 
817-     @unittest .skipIf (sys .platform  !=  "darwin" , "only macOS requires read permission to readlink()" ) 
818-     @_parameterize ({'strict' : True }, {'strict' : ALLOW_MISSING }) 
819-     def  test_realpath_unreadable_symlink_strict (self , kwargs ):
820-         try :
821-             os .symlink (ABSTFN + "1" , ABSTFN )
822-             os .chmod (ABSTFN , 0o000 , follow_symlinks = False )
823-             with  self .assertRaises (PermissionError ):
824-                 realpath (ABSTFN , ** kwargs )
825-             with  self .assertRaises (PermissionError ):
826-                 realpath (ABSTFN  +  '/foo' , ** kwargs ),
827-             with  self .assertRaises (PermissionError ):
828-                 realpath (ABSTFN  +  '/../foo' , ** kwargs )
829-             with  self .assertRaises (PermissionError ):
830-                 realpath (ABSTFN  +  '/foo/..' , ** kwargs )
831-         finally :
832-             os .chmod (ABSTFN , 0o755 , follow_symlinks = False )
833-             os .unlink (ABSTFN )
834- 
835798    @skip_if_ABSTFN_contains_backslash  
836799    @os_helper .skip_unless_symlink  
837800    def  test_realpath_unreadable_directory (self ):
0 commit comments