Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ecarreras
Last active August 29, 2015 13:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecarreras/10370290 to your computer and use it in GitHub Desktop.
Save ecarreras/10370290 to your computer and use it in GitHub Desktop.
Sitecustomize

Sitecustomize

Fix for unicode can't decode ascii...

import sys
actual_encoding = sys.getdefaultencoding()
try:
import locale
loc = locale.getdefaultlocale()
if loc[1]:
encoding = loc[1]
sys.setdefaultencoding(encoding)
except ImportError:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment