From: biao716.wang Date: Tue, 29 Aug 2023 12:30:53 +0000 (+0900) Subject: fix gbs export error X-Git-Tag: debian/0.9.27~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba67c11e6054062a5a5258bc628265fa394e12c6;p=tools%2Fgit-buildpackage.git fix gbs export error Change-Id: I8fb9b2654f2020bbf03e6e429f8bb395a7e345f8 Signed-off-by: biao716.wang --- diff --git a/gbp/config.py b/gbp/config.py index 0f0bdc6..8b65924 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -371,15 +371,15 @@ class GbpOptionParser(OptionParser): # Read per-tree config file if repo and git_treeish and filename.startswith('%(top_dir)s/'): - with tempfile.TemporaryFile() as tmp: + with tempfile.NamedTemporaryFile() as tmp: relpath = filename.replace('%(top_dir)s/', '') try: config = repo.show('%s:%s' % (git_treeish, relpath)) - tmp.writelines(config) + tmp.write(config) except GitRepositoryError: pass tmp.seek(0) - parser.readfp(tmp) + parser.read(tmp.name) return try: filename = filename % str_fields