]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-105089: Fix test_create_directory_with_write test failure in AIX (GH-105228...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 1 Feb 2024 12:22:54 +0000 (13:22 +0100)
committerGitHub <noreply@github.com>
Thu, 1 Feb 2024 12:22:54 +0000 (12:22 +0000)
(cherry picked from commit 4dbb198d279a06fed74ea4c38f93d658baf38170)

Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
Lib/test/test_zipfile/test_core.py
Misc/NEWS.d/next/Tests/2023-06-02-05-04-15.gh-issue-105089.KaZFtU.rst [new file with mode: 0644]

index 00fba11d23c85c4f5c46d662cf74faa6cde1229c..a6efcc5f4c20d504fa202c50e4bdcc4072e4dc6c 100644 (file)
@@ -2959,7 +2959,7 @@ class TestWithDirectory(unittest.TestCase):
 
             directory = os.path.join(TESTFN2, "directory2")
             os.mkdir(directory)
-            mode = os.stat(directory).st_mode
+            mode = os.stat(directory).st_mode & 0xFFFF
             zf.write(directory, arcname="directory2/")
             zinfo = zf.filelist[1]
             self.assertEqual(zinfo.filename, "directory2/")
diff --git a/Misc/NEWS.d/next/Tests/2023-06-02-05-04-15.gh-issue-105089.KaZFtU.rst b/Misc/NEWS.d/next/Tests/2023-06-02-05-04-15.gh-issue-105089.KaZFtU.rst
new file mode 100644 (file)
index 0000000..d04ef43
--- /dev/null
@@ -0,0 +1,4 @@
+Fix
+``test.test_zipfile.test_core.TestWithDirectory.test_create_directory_with_write``
+test in AIX by doing a bitwise AND of 0xFFFF on mode , so that it will be in
+sync with ``zinfo.external_attr``