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

Don't replace empty BODY with empty dict on resp.json() call #3482

Closed
asvetlov opened this issue Jan 4, 2019 · 8 comments
Closed

Don't replace empty BODY with empty dict on resp.json() call #3482

asvetlov opened this issue Jan 4, 2019 · 8 comments
Milestone

Comments

@asvetlov
Copy link
Member

asvetlov commented Jan 4, 2019

See #3362 (comment) note.

The change breaks backward compatibility but now the great chance to do it in aiohttp 4.0 :)

@asvetlov asvetlov added good first issue Good for newcomers client labels Jan 4, 2019
@asvetlov asvetlov added this to the 4.0 milestone Jan 4, 2019
@aio-libs-bot
Copy link

GitMate.io thinks possibly related issues are #918 (Empty CancelledError while parsing request body (question)), #2143 (FileResponse sends empty chunked body when returning 304), #758 (Empty body handled as error (204 No Content)), #815 (r.json() ), and #1726 (Add API to easily send JSON as request body).

@socketpair
Copy link
Contributor

Instead of empty dict it respond with None.

socketpair added a commit that referenced this issue Jan 4, 2019
@socketpair
Copy link
Contributor

Well, just curious... backward compatibility with what ?

socketpair added a commit that referenced this issue Jan 4, 2019
socketpair added a commit that referenced this issue Jan 4, 2019
socketpair added a commit that referenced this issue Jan 4, 2019
socketpair added a commit that referenced this issue Jan 4, 2019
socketpair added a commit that referenced this issue Jan 4, 2019
socketpair added a commit that referenced this issue Jan 4, 2019
socketpair added a commit that referenced this issue Jan 5, 2019
@socketpair
Copy link
Contributor

socketpair commented Jan 5, 2019

Merged

@asvetlov
Copy link
Member Author

asvetlov commented Jan 5, 2019

" \n \n " response now generates JSONDecodeError which is fine to me.
Before the merge it returned None.

@socketpair
Copy link
Contributor

" \n \n " response now generates JSONDecodeError which is fine to me.
Before the merge it returned None.

at the same time, ' \n { "x" : "y" } \n \n ' is a valid json

@asvetlov
Copy link
Member Author

asvetlov commented Jan 5, 2019

Yes.
My point is: the PR should be a part of next aiohttp 4.0 but cannot be backported into 3.5 bugfix branch

@lock
Copy link

lock bot commented Jan 5, 2020

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Jan 5, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants