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

Support Content-Transfer-Encoding binary #1169

Merged
merged 2 commits into from
Sep 16, 2016
Merged

Support Content-Transfer-Encoding binary #1169

merged 2 commits into from
Sep 16, 2016

Conversation

kxepal
Copy link
Member

@kxepal kxepal commented Sep 14, 2016

This fixes #1168

@codecov-io
Copy link

codecov-io commented Sep 14, 2016

Current coverage is 98.40% (diff: 100%)

Merging #1169 into master will decrease coverage by <.01%

@@             master      #1169   diff @@
==========================================
  Files            29         29          
  Lines          6535       6519    -16   
  Methods           0          0          
  Messages          0          0          
  Branches       1096       1094     -2   
==========================================
- Hits           6431       6415    -16   
  Misses           54         54          
  Partials         50         50          

Powered by Codecov. Last update 0199e4a...8dc3353

@asvetlov
Copy link
Member

LGTM

@@ -854,6 +856,8 @@ def _apply_content_transfer_encoding(self, stream):
elif encoding == 'quoted-printable':
for chunk in stream:
yield binascii.b2a_qp(chunk)
elif encoding == 'binary':
yield from stream

Choose a reason for hiding this comment

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

Does not work for me (ClientRequestError: Can not write request body'), we need:

 for chunk in stream:
      yield chunk

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm...ok, but why? This should be roughly the same.

Copy link

@AleksandrIakhnev AleksandrIakhnev Sep 14, 2016

Choose a reason for hiding this comment

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

Have you tried to make actual POST request? It is exception here https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/client_reqrep.py#L427 (got: class 'generator' - seems pretty clear that is not the same return

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, basically whole logic here is based around generators. Ok, will try to make a better test then to catch that problem. Thanks for report!

Choose a reason for hiding this comment

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

Thank you for quick response!

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Great, thanks a lot.

Copy link
Member Author

@kxepal kxepal Sep 16, 2016

Choose a reason for hiding this comment

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

@AleksandrIakhnev Sorry, but I failed to reproduce your issue: script you provided works for me returning 405 response from Google. I also add test about to make sure that it works right and expected.

Are you sure that nothing is missed there in your example?

Copy link

@AleksandrIakhnev AleksandrIakhnev Sep 16, 2016

Choose a reason for hiding this comment

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

Sorry, seems that I've tested not on the latest version of aiohttp, after updating it returns 405 response.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great! (:

@asvetlov
Copy link
Member

@kxepal do you want to include the patch into aiohttp 1.0?
Since I've finished #1173 personally I have no show stoppers for next release.

@kxepal
Copy link
Member Author

kxepal commented Sep 15, 2016

@asvetlov Yes, let's do that. I'll try to get to the code soon to close this one.

@asvetlov
Copy link
Member

Now the PR is ready, isn't it?

@kxepal
Copy link
Member Author

kxepal commented Sep 16, 2016

@asvetlov Indeed it is.

@kxepal kxepal merged commit bc8be3b into aio-libs:master Sep 16, 2016
@asvetlov
Copy link
Member

Awesome!
Let me make a new release than.
Not all bugs are fixed and still there are improvements worth to be done but we've reached to the next milestone.
aiohttp is ready for 1.0 :)

@kxepal
Copy link
Member Author

kxepal commented Sep 16, 2016

@asvetlov Great! Do you plan to cut the new release today?

@asvetlov
Copy link
Member

Yes. We was waiting it for very long, at least couple weeks longer that I expected.

@fafhrd91
Copy link
Member

fafhrd91 commented Sep 21, 2016

@kxepal hey, i am playing with rust async stuff. would you be interested in help me with mime type parsing?

@kxepal
Copy link
Member Author

kxepal commented Sep 21, 2016

@fafhrd91 I'm not very good with rust, but sure, ping me if you need a help - will try to make it.

@fafhrd91
Copy link
Member

fafhrd91 commented Sep 21, 2016

@kxepal i am not good either, i just started week ago :)
basically, i need mimetype streaming parser, and it could be just general library.
my code is here https://github.com/fafhrd91/simplehttp

@kxepal
Copy link
Member Author

kxepal commented Sep 21, 2016

@fafhrd91 Ok, will check, thanks!

@lock
Copy link

lock bot commented Oct 29, 2019

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 Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MultipartWriter does not support binary content encoding
5 participants