Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

HttpRequest throws exception when the body is an IO object #29

Open
yaxia opened this issue Nov 25, 2016 · 1 comment
Open

HttpRequest throws exception when the body is an IO object #29

yaxia opened this issue Nov 25, 2016 · 1 comment
Assignees

Comments

@yaxia
Copy link
Member

yaxia commented Nov 25, 2016

HttpRequest throws exception when the body is an IO object, because the code checks whether the body is an IO object but it actually uses the APIs of the File(derived from the IO object): body.size and body.path.

I am going to make a change to fix it. Here are some questions for discussion:

  1. Shall we support File object only? Is it by-design?
  2. Regarding API convenience, an IO or StringIO object may also be the body, shall we support it?

Thoughts? @vishrutshah , @veronicagg

@vishrutshah
Copy link
Contributor

@yaxia Thank you very much for bringing this up.

Using properties of File class with checks on IO class seems like a bug. I think we should support most possible scenarios for IO as you mentioned IO, File and StringIO as of now.

What are your views?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants