[Python-checkins] cpython (3.2): Issue #17248: Fix os.*chown() testing when user has group root.

serhiy.storchaka python-checkins at python.org
Wed Feb 20 18:53:54 CET 2013


http://hg.python.org/cpython/rev/a49bbaadce67
changeset:   82277:a49bbaadce67
branch:      3.2
parent:      82273:a0baf5347cd1
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Wed Feb 20 19:48:22 2013 +0200
summary:
  Issue #17248: Fix os.*chown() testing when user has group root.

files:
  Lib/test/test_posix.py |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -279,10 +279,11 @@
             # non-root cannot chown to root, raises OSError
             self.assertRaises(OSError, chown_func, first_param, 0, 0)
             check_stat(uid, gid)
-            self.assertRaises(OSError, chown_func, first_param, -1, 0)
-            check_stat(uid, gid)
             self.assertRaises(OSError, chown_func, first_param, 0, -1)
             check_stat(uid, gid)
+            if gid != 0:
+                self.assertRaises(OSError, chown_func, first_param, -1, 0)
+                check_stat(uid, gid)
         # test illegal types
         for t in str, float:
             self.assertRaises(TypeError, chown_func, first_param, t(uid), gid)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list