From e7957d7508e6c1e8f4403e6827e5ee82ce730159 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Mon, 3 Apr 2017 16:20:36 +0200 Subject: reproducible_json.py: Fix cross-device-link error by creating temp file in the same directory. Signed-off-by: Holger Levsen --- bin/reproducible_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/reproducible_json.py b/bin/reproducible_json.py index cfb6e95b..6fb6549a 100755 --- a/bin/reproducible_json.py +++ b/bin/reproducible_json.py @@ -114,7 +114,7 @@ for data, fn, target in ( (output4tracker, open, REPRODUCIBLE_TRACKER_JSON), (output4tracker, bz2.BZ2File, REPRODUCIBLE_TRACKER_JSON + '.bz2'), ): - tmpfile = tempfile.mkstemp()[1] + tmpfile = tempfile.mkstemp(dir=os.path.dirname(target))[1] with fn(tmpfile, 'w') as fd: json.dump(data, fd, indent=4, sort_keys=True) os.rename(tmpfile, target) -- cgit v1.2.3-70-g09d2