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
2 parents c439104 + dd7f7c0 commit 95a9ef8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,10 @@ def _get_home():
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 95a9ef8

Please sign in to comment.