Skip to content

Commit

Permalink
Merge pull request #5019 from jheinen/master
Browse files Browse the repository at this point in the history
Default to UTF-8 if locale.getdefaultlocale() returns None for the encoding
  • Loading branch information
jkseppan committed Sep 5, 2015
2 parents 0bbf040 + 258f445 commit 27606b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/matplotlib/__init__.py
Expand Up @@ -992,6 +992,8 @@ def _open_file_or_url(fname):
else:
fname = os.path.expanduser(fname)
encoding = locale.getdefaultlocale()[1]
if encoding is None:
encoding = "utf-8"
with io.open(fname, encoding=encoding) as f:
yield f

Expand Down

0 comments on commit 27606b7

Please sign in to comment.