From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:22:54 +0000 (+0100) Subject: [3.12] gh-105089: Fix test_create_directory_with_write test failure in AIX (GH-105228... X-Git-Tag: v3.12.2~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c5ecc85213d911c001bea2a6b14761680677a9c;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-105089: Fix test_create_directory_with_write test failure in AIX (GH-105228) (GH-114860) (cherry picked from commit 4dbb198d279a06fed74ea4c38f93d658baf38170) Co-authored-by: Ayappan Perumal --- diff --git a/Lib/test/test_zipfile/test_core.py b/Lib/test/test_zipfile/test_core.py index 00fba11d23c8..a6efcc5f4c20 100644 --- a/Lib/test/test_zipfile/test_core.py +++ b/Lib/test/test_zipfile/test_core.py @@ -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 index 000000000000..d04ef435dd57 --- /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``