Download CVE images instead of storing them on disk

This commit is contained in:
Andrew Murray 2020-07-16 19:06:46 +10:00
parent 74c8072945
commit 5795ec2f24

View File

@ -14,16 +14,20 @@
# version. # version.
import urllib.request
from PIL import Image from PIL import Image
repro_read_strip = ( repro_read_strip = (
"images/crash_1.tif", "crash_1.tif",
"images/crash_2.tif", "crash_2.tif",
) )
for path in repro_read_strip: for path in repro_read_strip:
with Image.open(path) as im: repo = "https://raw.githubusercontent.com/python-pillow/Pillow/master/"
try: with urllib.request.urlopen(repo + "Tests/images/" + path) as f:
im.load() with Image.open(f) as im:
except Exception as msg: try:
print(msg) im.load()
except Exception as msg:
print(msg)