-
Notifications
You must be signed in to change notification settings - Fork 963
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
Prevent duplicate POST
keys in requests
#16732
Conversation
@@ -487,6 +487,7 @@ def _sort_releases(request: Request, project: Project): | |||
require_csrf=False, | |||
require_methods=["POST"], | |||
has_translations=True, | |||
permit_duplicate_post_keys=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I'm aware, this is the only view where we actually depend on and permit duplicate keys.
Hi there, I think this PR has somehow broken the twine When I'm publishing to testpypi and I know there's a file there already, I am getting the error message POST body may not contain duplicate keys from this PR instead of the error message twine expects : I can't say 100% that it's this PR but it's the message I'm now getting and I can publish successfully when I bump the project version. N.B. I run a build and test publish after every push to master as per the Python Packaging user guide but only really care if the test publish succeeds just before a proper release. This now causes the CI to fail on the interim commits. |
Hi guys, Also running into this error as I am trying to upload some packages on TestPyPi and no matter what I do (version bump, change name, new project, etc) its giving me this |
Thanks! Looking into this now. |
Same for me:
twine version 5.1.1 (importlib-metadata: 8.5.0, keyring: 25.4.0, pkginfo: 1.10.0, requests: 2.32.3, requests-toolbelt: 1.0.0, urllib3: 2.2.3) command: |
Hey so actually I figured out my reason which was an issue in my Sorry for that! |
@MOmarMiraj Can you give us some more detail about what the issue in your |
I have classifiers defined. This is a part of a dump of
After removing classifiers the error disappeared (now pypi complains about not enabled 2FA) |
I still can't reproduce this myself but I've merged #16755 which might help, can anyone reporting issues here retry and see if this is still happening? |
In my
The license was missing the OSI Approved section and I was getting that error. The error message should've been more clear but this is what fixed mines |
We've identified the issue, #16759 will fix this once it's merged & deployed. |
To reproduce just try uploading a file with the same name and different hash twice should do it. |
Edited the reproduction steps above to specify using a different hash. |
Just tested with the latest deployment, all fixed many thanks! |
Seems to be ok now, thanks |
It worked. Thank you! |
is anyone else still getting this error where they didn't before? for me with Maturin - worked last night, but today seems to have stopped working. EDIT: looks to have been fixed in Maturin 1.7.3: https://github.com/PyO3/maturin/releases/tag/v1.7.3 |
Fixes https://python-software-foundation.sentry.io/share/issue/40756e6481274d3babdc620efac508a9/
Generally, duplicate
POST
keys in a request are an error for us. Rather than sanity-checking this everywhere we userequest.POST
, this PR adds a view deriver that returns an error if duplicate keys are present.