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

urlopen error [Errno 32] Broken pipe - Unix OS (Centos) #265

Closed
alepg opened this Issue Nov 19, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@alepg

alepg commented Nov 19, 2014

When I send a tweet with a picture from an UNIX system (Centos) occurs an error "urlopen error [Errno 32] Broken pipe". With Windows operating system that does not happen.

The code is as follows:

try:
    # Send a tweet with an image included (or set your banner or logo similarily)
    # by just reading your image from the web or a file in a string:
    with open(status, "rb") as imagefile:
        params = {"media[]": imagefile.read(), "status": "Test invio immagine..."}
    outcome = t.statuses.update_with_media(**params)
    ...

Traceback (most recent call last):
File "/usr/local/lib/python3.3/urllib/request.py", line 1248, in do_open h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/local/lib/python3.3/http/client.py", line 1061, in request self._send_request(method, url, body, headers)
File "/usr/local/lib/python3.3/http/client.py", line 1099, in _send_request self.endheaders(body)
File "/usr/local/lib/python3.3/http/client.py", line 1057, in endheaders self._send_output(message_body)
File "/usr/local/lib/python3.3/http/client.py", line 902, in _send_output self.send(msg)
File "/usr/local/lib/python3.3/http/client.py", line 871, in send self.sock.sendall(data)
File "/usr/local/lib/python3.3/ssl.py", line 425, in sendall v = self.send(data[count:])
File "/usr/local/lib/python3.3/ssl.py", line 386, in send v = self._sslobj.write(data)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/dstar/tmp/test2.py", line 53, in polling()
File "/dstar/tmp/test2.py", line 49, in polling send_to_twitter("image.jpg")
File "/dstar/tmp/test2.py", line 31, in send_to_twitter outcome = t.statuses.update_with_media(*_params)
File "/usr/local/lib/python3.3/site-packages/twitter-1.10.0-py3.3.egg/twitter/api.py", line 204, in call return self._handle_response(req, uri, arg_data, _timeout)
File "/usr/local/lib/python3.3/site-packages/twitter-1.10.0-py3.3.egg/twitter/api.py", line 211, in _handle_response handle = urllib_request.urlopen(req, *_kwargs)
File "/usr/local/lib/python3.3/urllib/request.py", line 156, in urlopen return opener.open(url, data, timeout)
File "/usr/local/lib/python3.3/urllib/request.py", line 469, in open response = self._open(req, data)
File "/usr/local/lib/python3.3/urllib/request.py", line 487, in _open '_open', req)
File "/usr/local/lib/python3.3/urllib/request.py", line 447, in _call_chain result = func(*args)
File "/usr/local/lib/python3.3/urllib/request.py", line 1283, in https_open context=self._context, check_hostname=self._check_hostname)
File "/usr/local/lib/python3.3/urllib/request.py", line 1251, in do_open raise URLError(err)
urllib.error.URLError: urlopen error [Errno 32] Broken pipe>

@RouxRC RouxRC added the media label Dec 24, 2014

RouxRC added a commit that referenced this issue Dec 24, 2014

@RouxRC RouxRC closed this Dec 24, 2014

@RouxRC

This comment has been minimized.

Collaborator

RouxRC commented Dec 24, 2014

should be fixed on master now, please have a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment