Skip to content

Commit

Permalink
Better detection of "file already exists" twine error
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Aug 13, 2021
1 parent 9b96217 commit 8995526
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/oca_github_bot/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit 8995526

Please sign in to comment.