Comment 7 for bug 312462

Revision history for this message
Carl Karsten (carlfk) wrote :

simple test:

fail:
carl@asus17:~/tss$ python -c "import poppler; poppler.document_new_from_data('\x00',1,password='')"
Xlib: extension "RANDR" missing on display "localhost:13.0".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: document_new_from_data() argument 1 must be string without null bytes, not str

pass:
juser@cp666:~/temp$ python -c "import poppler; poppler.document_new_from_data('\x00',1,password='')"
Xlib: extension "RANDR" missing on display "localhost:10.0".
Error: May not be a PDF file (continuing anyway)
Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table
Traceback (most recent call last):
  File "<string>", line 1, in <module>
glib.GError: PDF document is damaged

yeah, 0 is not a valid pdf. that's not the point.