From 8995526c511054324af667742e31f9cc1a32b054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 13 Aug 2021 10:40:28 +0200 Subject: [PATCH] Better detection of "file already exists" twine error --- src/oca_github_bot/pypi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/oca_github_bot/pypi.py b/src/oca_github_bot/pypi.py index 51b1cebf..1643026a 100644 --- a/src/oca_github_bot/pypi.py +++ b/src/oca_github_bot/pypi.py @@ -109,7 +109,10 @@ def publish(self, dist_dir: str, dry_run: bool) -> None: env=dict(os.environ, TWINE_PASSWORD=self._password), ) except CalledProcessError as e: - if "File already exists" in e.output: + if ( + "File already exists" in e.output + or "This filename has already been used" in e.output + ): # in case exist_on_index() received an outdated index page _logger.warning( f"Could not upload {filename} that already exists "