From: Andrew MacIntyre Date: Wed, 19 Feb 2003 12:51:34 +0000 (+0000) Subject: OS/2 has no concept of file ownership, like DOS & MS Windows version X-Git-Tag: v2.3c1~1767 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7970d20792eb4614a1dd6bd57dc5d9c107f28f35;p=python OS/2 has no concept of file ownership, like DOS & MS Windows version prior to NT. EMX has a number of Posix emulation routines, including geteuid() but lacks chown(), so silently skip trying to actually set a file ownership when extracting a file from a tar archive. --- diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 6a92a10e5b..32bb87efc8 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1505,7 +1505,8 @@ class TarFile(object): if tarinfo.issym() and hasattr(os, "lchown"): os.lchown(targetpath, u, g) else: - os.chown(targetpath, u, g) + if sys.platform != "os2emx": + os.chown(targetpath, u, g) except EnvironmentError, e: raise ExtractError, "could not change owner"