paulhoule / tentacruel

MIT License
0 stars 0 forks source link

Weather radar shouldn't get knocked out by a corrupt file. #33

Closed paulhoule closed 5 years ago

paulhoule commented 5 years ago

Here is an example:

TYX_20190417_1507_N0R

when this file gets read, it causes PIL to go bezerk:

File "/home/paul/.cache/pypoetry/virtualenvs/tentacruel-py3.7/lib/python3.7/site-packages/PIL/ImageFile.py", line 103, in __init__ 
self._open() 
File "/home/paul/.cache/pypoetry/virtualenvs/tentacruel-py3.7/lib/python3.7/site-packages/PIL/GifImagePlugin.py", line 90, in _open 
self._seek(0)  # get ready to read first frame 
File "/home/paul/.cache/pypoetry/virtualenvs/tentacruel-py3.7/lib/python3.7/site-packages/PIL/GifImagePlugin.py", line 247, in _seek 
bits = i8(self.fp.read(1)) 
File "/home/paul/.cache/pypoetry/virtualenvs/tentacruel-py3.7/lib/python3.7/site-packages/PIL/_binary.py", line 19, in i8 
return c if c.__class__ is int else c[0] 
IndexError: index out of range

The file has been downloaded, so the system gets hit by it over and over again so the radar image generation fails, and my tamamo mail gets filled up with junk.

paulhoule commented 5 years ago

There is a gif file embedded in the ticket but you can't see it because it is corrupt!

Windows refuses to load the gif file.

Getting rid of the file unblocked the system. In a case like this we should be able to handle it the same way we handle the other case that gives an error message.