From 7aab2eac7cf258e1759396d5b848d5b1f5f24da7 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 15 May 2019 11:39:25 +0200 Subject: [PATCH] Fix filemode for temporary files in yum spider This was broken in the python3 update, but it's only used when testing via temporary files and never in production, and thus went unnoticed. --- tools/ftp/spider_yum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ftp/spider_yum.py b/tools/ftp/spider_yum.py index 502eb4b1..f2b61364 100755 --- a/tools/ftp/spider_yum.py +++ b/tools/ftp/spider_yum.py @@ -112,7 +112,7 @@ if __name__ == "__main__": print("Failed to upload: %s" % x) sys.exit(1) else: - with NamedTemporaryFile(dir=os.path.dirname(os.path.abspath(args.target))) as f: + with NamedTemporaryFile(mode='w', dir=os.path.dirname(os.path.abspath(args.target))) as f: f.write(j) f.flush() if os.path.isfile(args.target): -- 2.11.4.GIT