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

Ignore duplicate files when uploading, instead of throwing error #2284

Closed
rsyring opened this issue Aug 7, 2017 · 2 comments
Closed

Ignore duplicate files when uploading, instead of throwing error #2284

rsyring opened this issue Aug 7, 2017 · 2 comments
Labels
feature request good first issue This issue is ideal for first-time contributors!

Comments

@rsyring
Copy link

rsyring commented Aug 7, 2017

Original complaint: https://gist.github.com/boppreh/ac7522b3a4ac46b4f6010eecddc57f21

Uploading distributions to https://upload.pypi.org/legacy/
Uploading package-1.2.3.zip
HTTPError: 400 Client Error: File already exists. for url: https://upload.pypi.org/legacy/

It's the exact same file. You could add a check for it and ignore, but no, it had to be an error.

And Donald's email reply on Distutils:

It's the exact same file. You could add a check for it and ignore, but no, it had to be an error.

This seems like a reasonable feature request, please file an issue with Warehouse asking for it so I don’t forget it.

@dstufft
Copy link
Member

dstufft commented Sep 17, 2017

Just to be clear, this should only no-op on files with the exact same hash, if someone tries to upload a different file with the same name that should still get the error as it is today.

@dstufft dstufft added good first issue This issue is ideal for first-time contributors! Post launch - low priority labels Sep 17, 2017
benjaminws added a commit to benjaminws/warehouse that referenced this issue Sep 19, 2017
- pypi#2284
- Move duplication check to happen after the temp file is
persisted, so a hash can be generated
- Create function to quuery for existing file and check hash
- Update unit tests to generate hash from file content, not name
since we need to test it
- Move file size check to happen after duplication check
dstufft added a commit to benjaminws/warehouse that referenced this issue Sep 22, 2017
benjaminws added a commit to benjaminws/warehouse that referenced this issue Sep 22, 2017
dstufft added a commit to benjaminws/warehouse that referenced this issue Sep 22, 2017
dstufft pushed a commit that referenced this issue Sep 22, 2017
@dstufft
Copy link
Member

dstufft commented Sep 22, 2017

Fixed in #2419.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue This issue is ideal for first-time contributors!
Projects
None yet
Development

No branches or pull requests

3 participants