Skip to content

Commit 734f200

Browse files
committed
Fixes to make Perlmutter tests pass
1 parent a54c842 commit 734f200

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

zstash/extract.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,11 @@ def _extractFiles_impl( # noqa: C901
743743
logger.debug("Valid md5: {} {}".format(md5, fname))
744744

745745
elif extract_this_file:
746-
tar.extract(tarinfo)
746+
# Python 3.11 and earlier don't support the filter parameter at all
747+
if sys.version_info >= (3, 12):
748+
tar.extract(tarinfo, filter="tar")
749+
else:
750+
tar.extract(tarinfo)
747751
# Note: tar.extract() will not restore time stamps of symbolic
748752
# links. Could not find a Python-way to restore it either, so
749753
# relying here on 'touch'. This is not the prettiest solution.

zstash/parallel.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,30 @@ def __init__(self, tars_to_print: List[str], manager=None, *args, **kwargs):
5252
def wait_turn(
5353
self, worker, workers_curr_tar: str, indef_wait: bool = True, *args, **kwargs
5454
):
55-
import sys
5655

5756
# Find the index of the worker's tar in the ordered list
5857
try:
5958
tar_index = self._tars_list.index(workers_curr_tar)
6059
except ValueError:
61-
sys.stderr.write(f"DEBUG: Tar {workers_curr_tar} not in list!\n")
62-
sys.stderr.flush()
60+
# sys.stderr.write(f"DEBUG: Tar {workers_curr_tar} not in list!\n")
61+
# sys.stderr.flush()
6362
return
6463

65-
sys.stderr.write(
66-
f"DEBUG: Worker waiting for tar {workers_curr_tar} (index {tar_index}), current index is {self._current_tar_index.value}\n"
67-
)
68-
sys.stderr.flush()
64+
# sys.stderr.write(
65+
# f"DEBUG: Worker waiting for tar {workers_curr_tar} (index {tar_index}), current index is {self._current_tar_index.value}\n"
66+
# )
67+
# sys.stderr.flush()
6968

7069
max_wait_time = 180.0
7170
start_time = time.time()
7271
attempted = False
7372

7473
while True:
7574
if self._current_tar_index.value == tar_index:
76-
sys.stderr.write(
77-
f"DEBUG: Worker got turn for tar {workers_curr_tar}!\n"
78-
)
79-
sys.stderr.flush()
75+
# sys.stderr.write(
76+
# f"DEBUG: Worker got turn for tar {workers_curr_tar}!\n"
77+
# )
78+
# sys.stderr.flush()
8079
return
8180

8281
if attempted and not indef_wait:

0 commit comments

Comments
 (0)