Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/test/eintrdata/eintr_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def _lock(self, lock_func, lock_name):
lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
lock_func(f, fcntl.LOCK_UN)
time.sleep(0.01)
except BlockingIOError:
except (BlockingIOError, PermissionError):
Comment thread
aixtools marked this conversation as resolved.
Resolved
break
# the child locked the file just a moment ago for 'sleep_time' seconds
# that means that the lock below will block for 'sleep_time' minus some
Expand Down
13 changes: 13 additions & 0 deletions Lib/test/test_shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

TESTFN2 = TESTFN + "2"
MACOS = sys.platform.startswith("darwin")
AIX = sys.platform[:3] == 'aix'
try:
import grp
import pwd
Expand Down Expand Up @@ -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)
Comment thread
aixtools marked this conversation as resolved.
Resolved
maxdata=hdrs.split("\n")[-1].split()[1]
return int(maxdata,16) >= 0x20000000
else:
return True

class TestShutil(unittest.TestCase):

Expand Down Expand Up @@ -1351,6 +1363,7 @@ def test_unpack_archive_bztar(self):
self.check_unpack_archive('bztar')

@support.requires_lzma
@unittest.skipIf(AIX and not _maxdataOK(), "AIX MAXDATA must be 0x20000000 or larger")
def test_unpack_archive_xztar(self):
self.check_unpack_archive('xztar')

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add PermissionError to the Exception: list
patch by Michael Felt, aixtools
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Prevent ''test_shutil.test_unpack_archive_xztar'' from MemoryError on 32-bit AIX
when MAXDATA setting is less than 0x20000000.
patch by Michael Felt, aixtools