From d4f49c05c5f4fbaeda24ec5b7b590ce36434a74d Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 4 Jul 2011 17:39:29 -0400 Subject: [PATCH] fix another binary-mode issue --- pdf.js | 1 + test/test.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pdf.js b/pdf.js index 814c99f75..48fa004e6 100644 --- a/pdf.js +++ b/pdf.js @@ -2971,6 +2971,7 @@ var Catalog = (function() { var PDFDoc = (function() { function constructor(stream) { + assertWellFormed(stream.length > 0, "stream must have data"); this.stream = stream; this.setup(); } diff --git a/test/test.py b/test/test.py index 367347e88..00b87f786 100644 --- a/test/test.py +++ b/test/test.py @@ -275,7 +275,7 @@ def downloadLinkedPDFs(manifestList): sys.stdout.flush() response = urllib2.urlopen(link) - with open(f, 'w') as out: + with open(f, 'wb') as out: out.write(response.read()) print 'done'