]> git.parisson.com Git - pdf.js.git/commitdiff
fix another binary-mode issue
authorChris Jones <jones.chris.g@gmail.com>
Mon, 4 Jul 2011 21:39:29 +0000 (17:39 -0400)
committerChris Jones <jones.chris.g@gmail.com>
Mon, 4 Jul 2011 21:39:29 +0000 (17:39 -0400)
pdf.js
test/test.py

diff --git a/pdf.js b/pdf.js
index 814c99f75f5ab8a9afc3db1b78ef82088d7e4b8c..48fa004e6424856be67432b567e4ddef5fa04642 100644 (file)
--- 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();
     }
index 367347e8814cd52f46ee0fa3092a414daa11b49b..00b87f78637c1f23d695f01e215fb16509212ccb 100644 (file)
@@ -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'