openzim / python-scraperlib

Collection of Python code to re-use across Python-based scrapers
GNU General Public License v3.0
17 stars 16 forks source link

Pillow 10.4.0 reveals improper type hints for image probing functions #177

Closed benoit74 closed 23 hours ago

benoit74 commented 3 days ago

Pyright error is:

openzim/python-scraperlib/src/zimscraperlib/image/probing.py:81:30 - error: Argument of type "BytesIO | Path | IOBase" cannot be assigned to parameter "fp" of type "StrOrBytesPath | IO[bytes]" in function "open" (reportArgumentType)

pillow has updated its type hint in 10.4.0 and reveals this flaw.