if (("Exif" in exif_dict) and len(exif_dict["Exif"]) or
("Interop" in exif_dict) and len(exif_dict["Interop"]) ): # <-- this permits missing Exif because of "or"
zeroth_ifd[ImageIFD.ExifTag] = 1
exif_is = True
exif_ifd = exif_dict["Exif"] # <-- this requires Exif
From _dump.py:
Not sure if it's expected or not, but Nikola has this case in its docs: https://getnikola.com/handbook.html#preserve-some-exif-data