Skip to content

Commit

Permalink
use python2 compatible Popen. Fix #8811 (#8826)
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte authored Nov 25, 2024
1 parent 362aaee commit 0445524
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/python/ServerUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,11 +750,11 @@ def checkS3Object(crabserver=None, objecttype=None, username=None, tarballname=N
downloadCommand += ' curl -v -s -f -o /dev/null --head '
downloadCommand += ' "%s"' % preSignedUrl

with subprocess.Popen(downloadCommand, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) as downloadProcess:
logger.debug("Will execute:\n%s", downloadCommand)
stdout, stderr = downloadProcess.communicate()
exitcode = downloadProcess.returncode
logger.debug('exitcode: %s\nstdout: %s', exitcode, stdout)
downloadProcess = subprocess.Popen(downloadCommand, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
logger.debug("Will execute:\n%s", downloadCommand)
stdout, stderr = downloadProcess.communicate()
exitcode = downloadProcess.returncode
logger.debug('exitcode: %s\nstdout: %s', exitcode, stdout)

if exitcode != 0:
raise Exception('Download command %s failed. stderr is:\n%s' % (downloadCommand, stderr))
Expand Down

0 comments on commit 0445524

Please sign in to comment.