openzim / python-scraperlib

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

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

Closed benoit74 closed 4 months ago

benoit74 commented 4 months 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.