firstlookmedia / pdf-redact-tools

a set of tools to help with securely redacting and stripping metadata from documents before publishing
Other
530 stars 50 forks source link

sanitize error: IndexError: list index out of range #15

Open maxlath opened 9 years ago

maxlath commented 9 years ago

running pdf-redact-tools --sanitize an-untrusted.pdf I got the following error:

Converting PDF to PNGs
Flattening PNGs
Traceback (most recent call last):
  File "/usr/bin/pdf-redact-tools", line 178, in <module>
    main()
  File "/usr/bin/pdf-redact-tools", line 170, in main
    if pdfrt.explode():
  File "/usr/bin/pdf-redact-tools", line 83, in explode
    filename_template = os.path.join(self.pages_dirname, filenames[0].replace('-0.png', '-{}.png'))
IndexError: list index out of range

It's a 5 Mo file, could that be too large for this operation? Any other clue on what could be the issue?

context:

thanks in advance!

ariccio commented 9 years ago

It looks a bit more like filenames is an empty list, thus there's no valid index. It's filled with the list of files in a directory... it must have somehow been filled with an empty directory?

bogomya commented 8 years ago

I have the same issue. Ubuntu 14.04

doctorcolossus commented 5 years ago

same issue here - pdf-redact-tools 0.1.2 on Arch Linux