Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages show non-PEP 625 filenames for PEP 625 compliant source dists #16687

Closed
konstin opened this issue Sep 11, 2024 · 2 comments
Closed
Labels
bug 🐛 requires triaging maintainers need to do initial inspection of issue

Comments

@konstin
Copy link
Contributor

konstin commented Sep 11, 2024

Describe the bug

I have upload a source dist called upload_test_1-0.2.1.tar.gz. When i attempt a re-upload, i get the following error:

400 File already exists ('upload-test-1-0.2.1.tar.gz', with blake2_256 hash 'ef4b7d1074c2d14f70a5c0763b49db9616901d72fb044db962ef242db888c2bd'). See https://test.pypi.org/help/#file-name-reuse for more information.

In the error, the filename uses package name normalization, not dist name normalization.

Expected behavior

Warehouse uses either the original name or PEP 625 (https://peps.python.org/pep-0625/#specification) normalized name in all user visible strings.

To Reproduce

Upload an sdist to testpypi. Reupload a different source dist with the same name to trigger an error message.

My Platform
n/a

Additional context
n/a

@konstin konstin added bug 🐛 requires triaging maintainers need to do initial inspection of issue labels Sep 11, 2024
@di
Copy link
Member

di commented Sep 11, 2024

Could you provide some more context? The specific commands and filenames you're using for each upload attempt would be helpful.

I'm guessing that you originally uploaded a file that would normalize to upload_test_1-0.2.1.tar.gz, renamed the file to upload-test-1-0.2.1.tar.gz, and then tried to upload it again, is that correct? I think that would produce the error message you're seeing.

In this case, the error message is attempting to provide details about the file the user is trying to upload, not the file that already exists, so it will contain whatever filename the user is trying to upload.

@konstin
Copy link
Contributor Author

konstin commented Sep 18, 2024

This was indeed an error in the client (renaming the file in the upload form) and not about the warehouse output, sorry for the noise!

@konstin konstin closed this as completed Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 requires triaging maintainers need to do initial inspection of issue
Projects
None yet
Development

No branches or pull requests

2 participants