@@ -393,8 +393,6 @@ class _NormalAccessor(_Accessor):
393393
394394 stat = os .stat
395395
396- lstat = os .lstat
397-
398396 open = os .open
399397
400398 listdir = os .listdir
@@ -403,12 +401,6 @@ class _NormalAccessor(_Accessor):
403401
404402 chmod = os .chmod
405403
406- if hasattr (os , "lchmod" ):
407- lchmod = os .lchmod
408- else :
409- def lchmod (self , path , mode ):
410- raise NotImplementedError ("os.lchmod() not available on this system" )
411-
412404 mkdir = os .mkdir
413405
414406 unlink = os .unlink
@@ -1191,12 +1183,12 @@ def resolve(self, strict=False):
11911183 normed = self ._flavour .pathmod .normpath (s )
11921184 return self ._from_parts ((normed ,))
11931185
1194- def stat (self ):
1186+ def stat (self , * , follow_symlinks = True ):
11951187 """
11961188 Return the result of the stat() system call on this path, like
11971189 os.stat() does.
11981190 """
1199- return self ._accessor .stat (self )
1191+ return self ._accessor .stat (self , follow_symlinks = follow_symlinks )
12001192
12011193 def owner (self ):
12021194 """
@@ -1286,18 +1278,18 @@ def mkdir(self, mode=0o777, parents=False, exist_ok=False):
12861278 if not exist_ok or not self .is_dir ():
12871279 raise
12881280
1289- def chmod (self , mode ):
1281+ def chmod (self , mode , * , follow_symlinks = True ):
12901282 """
12911283 Change the permissions of the path, like os.chmod().
12921284 """
1293- self ._accessor .chmod (self , mode )
1285+ self ._accessor .chmod (self , mode , follow_symlinks = follow_symlinks )
12941286
12951287 def lchmod (self , mode ):
12961288 """
12971289 Like chmod(), except if the path points to a symlink, the symlink's
12981290 permissions are changed, rather than its target's.
12991291 """
1300- self ._accessor . lchmod ( self , mode )
1292+ self .chmod ( mode , follow_symlinks = False )
13011293
13021294 def unlink (self , missing_ok = False ):
13031295 """
@@ -1321,7 +1313,7 @@ def lstat(self):
13211313 Like stat(), except if the path points to a symlink, the symlink's
13221314 status information is returned, rather than its target's.
13231315 """
1324- return self ._accessor . lstat ( self )
1316+ return self .stat ( follow_symlinks = False )
13251317
13261318 def link_to (self , target ):
13271319 """
0 commit comments