Skip to content

Commit

Permalink
Merge pull request #3594 from wernerfb/UnicodeInitProblem
Browse files Browse the repository at this point in the history
BUG : Unicode decode error on with unicode username on py2+win
  • Loading branch information
tacaswell committed Sep 30, 2014
1 parent 638adf4 commit df4e10a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/matplotlib/__init__.py
Expand Up @@ -506,7 +506,10 @@ def _get_home():
:see: http://mail.python.org/pipermail/python-list/2005-February/325395.html
"""
try:
path = os.path.expanduser("~")
if six.PY2 and sys.platform == 'win32':
path = os.path.expanduser(b"~").decode(sys.getfilesystemencoding())
else:
path = os.path.expanduser("~")
except ImportError:
# This happens on Google App Engine (pwd module is not present).
pass
Expand Down

0 comments on commit df4e10a

Please sign in to comment.