Skip to content

Instantly share code, notes, and snippets.

@philsturgeon
Created April 25, 2014 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philsturgeon/11284868 to your computer and use it in GitHub Desktop.
Save philsturgeon/11284868 to your computer and use it in GitHub Desktop.
Python UTF-8 Fun
Traceback (most recent call last):
File "facebook_cover.py", line 44, in <module>
photo = graph.put_photo(image_resource, album_id=payload['page_id'])
File "/task/__pips__/facebook.py", line 219, in put_photo
data = urllib2.urlopen(req).read()
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 400, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 418, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1174, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
File "/usr/lib/python2.7/httplib.py", line 958, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 992, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 812, in _send_output
msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 423: ordinal not in range(128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment