From 2e4d3d518ec60a371ecc582f776953e79b9630cc Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Wed, 15 May 2019 15:17:29 -0700 Subject: [PATCH] cookbook/container/default.sha256.do: use explicit close_fds=False. Some people have /usr/bin/python as a link to python3. The script is designed to work in either python2 or python3, but python3's subprocess model defaults to close_fds=True, which closes the jobserver fds and causes an error. Explicitly force close_fds=False to get identical behaviour on python2 and python3. Reported-by: Tharre --- docs/cookbook/container/default.sha256.do | 2 +- docs/cookbook/container/dockjson.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cookbook/container/default.sha256.do b/docs/cookbook/container/default.sha256.do index bb6e042..67f1e83 100644 --- a/docs/cookbook/container/default.sha256.do +++ b/docs/cookbook/container/default.sha256.do @@ -5,7 +5,7 @@ import hashlib, os, subprocess, sys subprocess.check_call([ 'redo-ifchange', sys.argv[2], -]) +], close_fds=False) h = hashlib.sha256() f = open(sys.argv[2]) diff --git a/docs/cookbook/container/dockjson.py b/docs/cookbook/container/dockjson.py index cb01640..11a4bec 100755 --- a/docs/cookbook/container/dockjson.py +++ b/docs/cookbook/container/dockjson.py @@ -1,6 +1,6 @@ #!/usr/bin/env python """Generate a docker 1.0-style manifest for a docker image.""" -import json, os, subprocess, sys, time +import json, os, sys, time j = json.load(open('template.json')) layerid = open(sys.argv[1] + '.list.sha256').read().strip()