Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9e311d9

Browse filesBrowse files
committed
Don't include the postscript title if it is not latin-1 encodable.
1 parent 634640f commit 9e311d9
Copy full SHA for 9e311d9

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed

‎lib/matplotlib/backends/backend_ps.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_ps.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ def _print_figure(
984984
if isinstance(outfile,
985985
(six.string_types, getattr(os, "PathLike", ()),)):
986986
outfile = title = getattr(os, "fspath", lambda obj: obj)(outfile)
987+
title = title.encode("latin-1", "replace").decode()
987988
passed_in_file_object = False
988989
elif is_writable_file_like(outfile):
989990
title = None
@@ -1071,7 +1072,7 @@ def print_figure_impl(fh):
10711072
else:
10721073
print("%!PS-Adobe-3.0", file=fh)
10731074
if title:
1074-
print("%%Title: "+title, file=fh)
1075+
print("%%Title: " + title, file=fh)
10751076
print("%%Creator: " + creator_str, file=fh)
10761077
# get source date from SOURCE_DATE_EPOCH, if set
10771078
# See https://reproducible-builds.org/specs/source-date-epoch/
@@ -1081,7 +1082,7 @@ def print_figure_impl(fh):
10811082
int(source_date_epoch)).strftime("%a %b %d %H:%M:%S %Y")
10821083
else:
10831084
source_date = time.ctime()
1084-
print("%%CreationDate: "+source_date, file=fh)
1085+
print("%%CreationDate: " + source_date, file=fh)
10851086
print("%%Orientation: " + orientation, file=fh)
10861087
if not isEPSF:
10871088
print("%%DocumentPaperSizes: "+papertype, file=fh)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.