From e2c50fb8c1c2a88d0c7b0d16fc5ea7ec1c691a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 8 Oct 2019 17:55:37 +0200 Subject: [PATCH] be sure that destination is not existing before overwriting content we used to crash on utf encoding errors, be sure not to replace meta data in that case --- osc/core.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osc/core.py b/osc/core.py index 032f62fa..1666c176 100644 --- a/osc/core.py +++ b/osc/core.py @@ -5145,9 +5145,10 @@ def link_pac(src_project, src_package, dst_project, dst_package, force, rev='', if root.get('project') != dst_project: # The source comes from a different project via a project link, we need to create this instance meta_change = True - except: + except HTTPError as e: + if e.code != 404: + raise meta_change = True - if meta_change: if missing_target: dst_meta = '<description/></package>' % dst_package @@ -5239,7 +5240,9 @@ def aggregate_pac(src_project, src_package, dst_project, dst_package, repo_map = if root.get('project') != dst_project: # The source comes from a different project via a project link, we need to create this instance meta_change = True - except: + except HTTPError as e: + if e.code != 404: + raise meta_change = True if meta_change: