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

Form data processed #4351

Merged
merged 9 commits into from
Nov 18, 2019
Merged

Form data processed #4351

merged 9 commits into from
Nov 18, 2019

Conversation

AtomsForPeace
Copy link
Contributor

@AtomsForPeace AtomsForPeace commented Nov 17, 2019

What do these changes do?

A FormData instance keeps track whether it has been processed already. If the instance is sent for a second time then it raises a ClientPayloadError.

Are there changes in behavior for the user?

Will raise an exception if they try to resend a FormData instance.

Related issue number

#4345

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Nov 17, 2019
@codecov-io
Copy link

codecov-io commented Nov 17, 2019

Codecov Report

Merging #4351 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4351      +/-   ##
==========================================
- Coverage   97.49%   97.48%   -0.02%     
==========================================
  Files          43       43              
  Lines        8857     8861       +4     
  Branches     1388     1389       +1     
==========================================
+ Hits         8635     8638       +3     
- Misses         97       98       +1     
  Partials      125      125
Impacted Files Coverage Δ
aiohttp/formdata.py 98.92% <100%> (+0.04%) ⬆️
aiohttp/web_fileresponse.py 97.72% <0%> (-0.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4758b26...e028991. Read the comment docs.

@AtomsForPeace
Copy link
Contributor Author

AtomsForPeace commented Nov 17, 2019

I decided to raise a ClientPayloadError if the FormData instance has already been processed. Is this the best Exception or is there something more fitting?

I also think this code could break some people's code as even in some of the other tests code broke.

Should I add documentation somewhere?

aiohttp/formdata.py Outdated Show resolved Hide resolved
aiohttp/formdata.py Outdated Show resolved Hide resolved
@asvetlov
Copy link
Member

Change-note is enough, I don't think we should document it additionally.

Copy link
Member

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@asvetlov asvetlov merged commit 0273535 into aio-libs:master Nov 18, 2019
asvetlov pushed a commit that referenced this pull request Nov 18, 2019
(cherry picked from commit 0273535)

Co-authored-by: Adam Bannister <adam.p.bannister@gmail.com>
asvetlov added a commit that referenced this pull request Nov 18, 2019
(cherry picked from commit 0273535)

Co-authored-by: Adam Bannister <adam.p.bannister@gmail.com>
asvetlov pushed a commit that referenced this pull request Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants