Skip to content

Commit 181ce57

Browse files
committed
BUG : fix str vs bytes issue in py3 in ps backend
de-code the encoded ascii string so that it is a string, not bytes, when it gets passed to the format function. Having the b'' from the bytes string appear in the eps file breaks the file. closes #3494
1 parent c103278 commit 181ce57

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
@@ -764,7 +764,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
764764
except KeyError:
765765
ps_name = sfnt[(3,1,0x0409,6)].decode(
766766
'utf-16be')
767-
ps_name = ps_name.encode('ascii', 'replace')
767+
ps_name = ps_name.encode('ascii', 'replace').decode('ascii')
768768
self.set_font(ps_name, prop.get_size_in_points())
769769

770770
cmap = font.get_charmap()

0 commit comments

Comments
 (0)