GithubHelp home page GithubHelp logo

POST + file + auth about requests HOT 6 CLOSED

psf avatar psf commented on July 2, 2024
POST + file + auth

from requests.

Comments (6)

kennethreitz avatar kennethreitz commented on July 2, 2024

Looks like the issue is actually being caused by evenlet, which I enable if it's installed.

In the next release, the library won't monkeypatch automatically, which will fix this issue. I hope to push that out this evening, or tomorrow.

In the meantime, either uninstall eventlet from your virtualenv or take out these lines (https://github.com/kennethreitz/requests/blob/master/requests/core.py#L19-30)

from requests.

flaper87 avatar flaper87 commented on July 2, 2024

Hi,

thanks for the quick answer...

I did that, doing so raises this exception:

File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 383, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 401, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 361, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 1130, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 1102, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 874, in request
self._send_request(method, url, body, headers)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 914, in _send_request
self.send(body)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 719, in send
self.sock.sendall(str)
File "", line 1, in sendall
TypeError: sendall() argument 1 must be string or buffer, not instance

Where str in self.sock.sendall(str) is an instance of multipart_yielder which is being passed for some reason. I've noticed that using auth, the _StreamingHTTPMixin is not called I might be wrong though...

from requests.

kennethreitz avatar kennethreitz commented on July 2, 2024

Hmm, thanks for letting me know. You're using the Python 2.6 that comes with Snow Leopard?

from requests.

flaper87 avatar flaper87 commented on July 2, 2024

Yeap, I have a small workaround for this (just waiting for your commit). If you haven't fixed this I can fork and do the pull request.

from requests.

kennethreitz avatar kennethreitz commented on July 2, 2024

I haven't fixed it yet. If you have, feel free to send a pull request. :)

from requests.

kennethreitz avatar kennethreitz commented on July 2, 2024

Merged!

from requests.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.