should be equivalent to using os.lchown() before. (cherry picked from commit 094376a8ad23c218defcc69d601be0b014965243)
@@ -472,7 +472,7 @@ Number of files: {0.stats.nfiles}'''.format(
if fd:
os.fchown(fd, uid, gid)
else:
- os.lchown(path, uid, gid)
+ os.chown(path, uid, gid, follow_symlinks=False)
except OSError:
pass
@@ -120,7 +120,7 @@ class PythonLibcTooOld(Error):
def check_python():
- required_funcs = {os.stat, os.utime}
+ required_funcs = {os.stat, os.utime, os.chown}
if not os.supports_follow_symlinks.issuperset(required_funcs):
raise PythonLibcTooOld