From: Chris Jones Date: Mon, 4 Jul 2011 21:39:29 +0000 (-0400) Subject: fix another binary-mode issue X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d4f49c05c5f4fbaeda24ec5b7b590ce36434a74d;p=pdf.js.git fix another binary-mode issue --- diff --git a/pdf.js b/pdf.js index 814c99f..48fa004 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 367347e..00b87f7 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'