From af6655ecfcd8f14ba88e56a19da7e4a5597d5c78 Mon Sep 17 00:00:00 2001 From: Ayappan P Date: Fri, 2 Jun 2023 04:49:35 -0400 Subject: [PATCH 1/2] pythongh-105089: Fix test_create_directory_with_write failure in AIX --- Lib/test/test_zipfile/test_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_zipfile/test_core.py b/Lib/test/test_zipfile/test_core.py index 9960259c4cde0c..64b455851a8c5c 100644 --- a/Lib/test/test_zipfile/test_core.py +++ b/Lib/test/test_zipfile/test_core.py @@ -2872,7 +2872,7 @@ def test_create_directory_with_write(self): 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/") From ba8e302075ff2bee561fbf72d234c341d21b92e1 Mon Sep 17 00:00:00 2001 From: Ayappan P Date: Fri, 2 Jun 2023 05:05:27 -0400 Subject: [PATCH 2/2] Add NEWS entry --- .../next/Tests/2023-06-02-05-04-15.gh-issue-105089.KaZFtU.rst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2023-06-02-05-04-15.gh-issue-105089.KaZFtU.rst 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 index 00000000000000..d04ef435dd572d --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2023-06-02-05-04-15.gh-issue-105089.KaZFtU.rst @@ -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``