Skip to content

Instantly share code, notes, and snippets.

@venkatesh22
Created August 3, 2013 07:29
Show Gist options
  • Save venkatesh22/6145594 to your computer and use it in GitHub Desktop.
Save venkatesh22/6145594 to your computer and use it in GitHub Desktop.
fix for UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 1451: ordinal not in range(128) in httplib python2.7 lib
msg += message_body.encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 1451: ordinal not in range(128)
httplib python2.7 library
r = urllib2.Request(str(url), body, headers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment