]> granicus.if.org Git - python/commitdiff
Issue #25583: Merge makedirs fix from 3.4 into 3.5
authorMartin Panter <vadmium+py@gmail.com>
Fri, 20 Nov 2015 02:35:46 +0000 (02:35 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Fri, 20 Nov 2015 02:35:46 +0000 (02:35 +0000)
1  2 
Lib/os.py
Lib/test/test_os.py
Misc/NEWS

diff --cc Lib/os.py
Simple merge
index 1e67e7ab1942c11fb4d25dd4aaaed9b7d65ad3b0,e29b0d585c723004635d1d02d6669e587fd6ec66..618c18abedd390864ab0a5f84a0a375a311ffd94
@@@ -1040,6 -971,20 +1040,9 @@@ class MakedirTests(unittest.TestCase)
          os.makedirs(path, mode=mode, exist_ok=True)
          os.umask(old_mask)
  
 -    @unittest.skipUnless(hasattr(os, 'chown'), 'test needs os.chown')
 -    def test_chown_uid_gid_arguments_must_be_index(self):
 -        stat = os.stat(support.TESTFN)
 -        uid = stat.st_uid
 -        gid = stat.st_gid
 -        for value in (-1.0, -1j, decimal.Decimal(-1), fractions.Fraction(-2, 2)):
 -            self.assertRaises(TypeError, os.chown, support.TESTFN, value, gid)
 -            self.assertRaises(TypeError, os.chown, support.TESTFN, uid, value)
 -        self.assertIsNone(os.chown(support.TESTFN, uid, gid))
 -        self.assertIsNone(os.chown(support.TESTFN, -1, -1))
 -
+         # Issue #25583: A drive root could raise PermissionError on Windows
+         os.makedirs(os.path.abspath('/'), exist_ok=True)
      def test_exist_ok_s_isgid_directory(self):
          path = os.path.join(support.TESTFN, 'dir1')
          S_ISGID = stat.S_ISGID
diff --cc Misc/NEWS
Simple merge