Skip to content

Instantly share code, notes, and snippets.

@mre
Created March 1, 2013 12:14
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 mre/5064256 to your computer and use it in GitHub Desktop.
Save mre/5064256 to your computer and use it in GitHub Desktop.
Unexpected error: 'ascii' codec can't decode byte 0xc3 (UnicodeDecodeError)
I got this message when I tried to open a shell on my application:
$ dotcloud run www
==> Opening a shell on service (www) instance #0 (application trips)
Error: An unexpected error has occured: 'ascii' codec can't decode byte 0xc3 in position 67: ordinal not in range(128).
The remote server handling the last request was 174.129.124.156:443.
The remote timestamp was Thu, 28 Feb 2013 15:06:19 GMT.
Please try again; and if the problem persists, contact support@dotcloud.com with this information.
Adding the following to /usr/local/lib/python2.7/site-packages/sitecustomize.py fixed the error:
sys.setdefaultencoding("utf-8")
(Make sure that you are patching the correct python environment e.g. python2.6, python2.7,...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment