From 3d1cd63afdc5460ed9029b5c2e0bd9aae67fbfc9 Mon Sep 17 00:00:00 2001 From: Esteban Santana Santana Date: Wed, 20 Nov 2013 02:41:35 -0600 Subject: [PATCH] We need to write bytes not strings. Python3 compatibility issue, we need to write bytes to buffers and pipes, not strings. This should still work in python2.6+. --- PIL/EpsImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/EpsImagePlugin.py b/PIL/EpsImagePlugin.py index 4acd72f33..5e53fc387 100644 --- a/PIL/EpsImagePlugin.py +++ b/PIL/EpsImagePlugin.py @@ -89,7 +89,7 @@ def Ghostscript(tile, size, fp, scale=1): gs = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE) # adjust for image origin if bbox[0] != 0 or bbox[1] != 0: - gs.stdin.write("%d %d translate\n" % (-bbox[0], -bbox[1])) + gs.stdin.write(b"%d %d translate\n" % (-bbox[0], -bbox[1])) fp.seek(offset) while length > 0: s = fp.read(8192)