Skip to content

Commit 27606b7

Browse files
committed
Merge pull request matplotlib#5019 from jheinen/master
Default to UTF-8 if locale.getdefaultlocale() returns None for the encoding
2 parents 0bbf040 + 258f445 commit 27606b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,8 @@ def _open_file_or_url(fname):
992992
else:
993993
fname = os.path.expanduser(fname)
994994
encoding = locale.getdefaultlocale()[1]
995+
if encoding is None:
996+
encoding = "utf-8"
995997
with io.open(fname, encoding=encoding) as f:
996998
yield f
997999

0 commit comments

Comments
 (0)