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

Skip to content

Commit 25e413f

Browse files
committed
Fix latin-1-ization of Title in eps.
We want `title` to be latin-1-encodable, so decoding it as utf-8 (the default) won't work (if there are characters with the highest bit set).
1 parent 5308e6b commit 25e413f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ def _print_figure(
972972
isEPSF = format == 'eps'
973973
if isinstance(outfile, (str, getattr(os, "PathLike", ()),)):
974974
outfile = title = getattr(os, "fspath", lambda obj: obj)(outfile)
975-
title = title.encode("latin-1", "replace").decode()
975+
title = title.encode("latin-1", "replace").decode("latin-1")
976976
passed_in_file_object = False
977977
elif is_writable_file_like(outfile):
978978
title = None

0 commit comments

Comments
 (0)