[Python-checkins] bpo-35704: Prevent test_shutil fail result when AIX is 32-bit and MAXDATA < 0x20000000 (GH-11500)

Miss Islington (bot) webhook-mailer at python.org
Mon Feb 18 06:02:51 EST 2019

commit: ef110b18074300e2302a68a2a476ae35bead7916
branch: master
author: Michael Felt <aixtools at users.noreply.github.com>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2019-02-18T03:02:44-08:00

bpo-35704: Prevent test_shutil fail result when AIX is 32-bit and MAXDATA < 0x20000000 (GH-11500)


A Misc/NEWS.d/next/Tests/2019-01-04-17-44-41.bpo-35633.wHfVop.rst
M Lib/test/test_shutil.py

diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index e3a0e702eee3..86f4dc97c3a1 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -34,6 +34,7 @@
 MACOS = sys.platform.startswith("darwin")
+AIX = sys.platform[:3] == 'aix'
     import grp
     import pwd
@@ -141,6 +142,17 @@ def supports_file2file_sendfile():
 SUPPORTS_SENDFILE = supports_file2file_sendfile()
+# AIX 32-bit mode, by default, lacks enough memory for the xz/lzma compiler test
+# The AIX command 'dump -o program' gives XCOFF header information
+# The second word of the last line in the maxdata value
+# when 32-bit maxdata must be greater than 0x1000000 for the xz test to succeed
+def _maxdataOK():
+    if AIX and sys.maxsize == 2147483647:
+        hdrs=subprocess.getoutput("/usr/bin/dump -o %s" % sys.executable)
+        maxdata=hdrs.split("\n")[-1].split()[1]
+        return int(maxdata,16) >= 0x20000000
+    else:
+        return True
 class TestShutil(unittest.TestCase):
@@ -1351,6 +1363,7 @@ def test_unpack_archive_bztar(self):
+    @unittest.skipIf(AIX and not _maxdataOK(), "AIX MAXDATA must be 0x20000000 or larger")
     def test_unpack_archive_xztar(self):
diff --git a/Misc/NEWS.d/next/Tests/2019-01-04-17-44-41.bpo-35633.wHfVop.rst b/Misc/NEWS.d/next/Tests/2019-01-04-17-44-41.bpo-35633.wHfVop.rst
new file mode 100644
index 000000000000..8ad7bd2475c0
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-01-04-17-44-41.bpo-35633.wHfVop.rst
@@ -0,0 +1,2 @@
+Add PermissionError to the Exception: list
+patch by Michael Felt, aixtools

More information about the Python-checkins mailing list