Skip to content
Advertisement

Tag: file-type

Opening zipfile of unsupported compression-type silently returns empty filestream, instead of throwing exception

Seem to be knocking my head off a newbie error and I am not a newbie. I have a 1.2G known-good zipfile ‘train.zip’ containing a 3.5G file ‘train.csv’. I open the zipfile and file itself without any exceptions (no LargeZipFile), but the resulting filestream appears to be empty. (UNIX ‘unzip -c …’ confirms it is good) The file objects returned

Inexpensive ways to add seek to a filetype object

PdfFileReader reads the content from a pdf file to create an object. I am querying the pdf from a cdn via urllib.urlopen(), this provides me a file like object, which has no seek. PdfFileReader, however uses seek. What is the simple way to create a PdfFileReader object from a pdf downloaded via url. Now, what can I do to avoid

Advertisement