fix gbs export error 84/297984/1
authorbiao716.wang <biao716.wang@samsung.com>
Tue, 29 Aug 2023 12:30:53 +0000 (21:30 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Tue, 29 Aug 2023 12:30:53 +0000 (21:30 +0900)
Change-Id: I8fb9b2654f2020bbf03e6e429f8bb395a7e345f8
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
gbp/config.py

index 0f0bdc6..8b65924 100644 (file)
@@ -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