@@ -984,6 +984,7 @@ def _print_figure(
984
984
if isinstance (outfile ,
985
985
(six .string_types , getattr (os , "PathLike" , ()),)):
986
986
outfile = title = getattr (os , "fspath" , lambda obj : obj )(outfile )
987
+ title = title .encode ("latin-1" , "replace" ).decode ()
987
988
passed_in_file_object = False
988
989
elif is_writable_file_like (outfile ):
989
990
title = None
@@ -1071,7 +1072,7 @@ def print_figure_impl(fh):
1071
1072
else :
1072
1073
print ("%!PS-Adobe-3.0" , file = fh )
1073
1074
if title :
1074
- print ("%%Title: " + title , file = fh )
1075
+ print ("%%Title: " + title , file = fh )
1075
1076
print ("%%Creator: " + creator_str , file = fh )
1076
1077
# get source date from SOURCE_DATE_EPOCH, if set
1077
1078
# See https://reproducible-builds.org/specs/source-date-epoch/
@@ -1081,7 +1082,7 @@ def print_figure_impl(fh):
1081
1082
int (source_date_epoch )).strftime ("%a %b %d %H:%M:%S %Y" )
1082
1083
else :
1083
1084
source_date = time .ctime ()
1084
- print ("%%CreationDate: " + source_date , file = fh )
1085
+ print ("%%CreationDate: " + source_date , file = fh )
1085
1086
print ("%%Orientation: " + orientation , file = fh )
1086
1087
if not isEPSF :
1087
1088
print ("%%DocumentPaperSizes: " + papertype , file = fh )
0 commit comments