Merge pull request #3460 from radarhere/check_png_dos

Corrected TypeError in Python 3
This commit is contained in:
Hugo 2018-11-16 23:26:49 +02:00 committed by GitHub
commit 9eb36da0b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -36,7 +36,7 @@ class TestPngDos(PillowTestCase):
def test_dos_total_memory(self):
im = Image.new('L', (1, 1))
compressed_data = zlib.compress('a'*1024*1023)
compressed_data = zlib.compress(b'a'*1024*1023)
info = PngImagePlugin.PngInfo()

View File

@ -10,7 +10,9 @@ if __name__ == "__main__":
print(" f._load_pilfont_data(")
print(" # %s" % os.path.basename(font))
print(" BytesIO(base64.decodestring(b'''")
base64.encode(open(font + ".pil", "rb"), sys.stdout)
with open(font + ".pil", "rb") as fp:
print(base64.b64encode(fp.read()).decode())
print("''')), Image.open(BytesIO(base64.decodestring(b'''")
base64.encode(open(font + ".pbm", "rb"), sys.stdout)
with open(font + ".pbm", "rb") as fp:
print(base64.b64encode(fp.read()).decode())
print("'''))))")