Delete an existing project on pypi and then create one with the same name but got error — the filename has already been used

As described in the title,

I deleted an existing pypi project, and then try to create a new one using the same name. Then I got the following error:

HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
This filename has already been used, use a different version. See https://pypi.org/help/#file-name-reuse for more information.

In pypi project setting page, here is the description of the DELETE

Warning Deleting this project will:

Irreversibly delete the project along with 1 release
Make the project name available to any other PyPI user
This user will be able to make new releases under this project name, so long as the distribution filenames do not match filenames from a previously released distribution (all PyPI distribution filenames are unique, as they are generated by combining the project name + version number + distribution type)

So is it a pypi system bug or just because that pypi may have some cache mechanism and you can only be allowed to create the same package after the original one deleted for a while?

It’s not a bug; it’s a feature. This is PyPI working as it’s intended to work. Read the deletion message carefully:

This user will be able to make new releases under this project name, so long as the distribution filenames do not match filenames from a previously released distribution (all PyPI distribution filenames are unique, as they are generated by combining the project name + version number + distribution type)

Thanks. That makes sense.

I figured it out. You cannot use the same release number + package name even the project is deleted.

But you can make a new release with a new version number.