Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ba21b0

Browse files
committed
Use file system encoding for the psfonts file name
1 parent 92e2c52 commit 5ba21b0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/dviread.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,8 @@ def __init__(self, filename):
839839
self._font = {}
840840
self._filename = filename
841841
if six.PY3 and isinstance(filename, bytes):
842-
self._filename = filename.decode('ascii', errors='replace')
842+
encoding = sys.getfilesystemencoding() or 'utf-8'
843+
self._filename = filename.decode(encoding, errors='replace')
843844
with open(filename, 'rb') as file:
844845
self._parse(file)
845846

0 commit comments

Comments
 (0)