Skip to content

26a641bf-ls8

Choose a tag to compare

@github-actions github-actions released this 20 Nov 10:05
· 3 commits to master since this release

CI

Test report · Build status

LinuxServer changes

Full Changelog: 26a641bf-ls7...26a641bf-ls8

Upstream changes

Source: HTPC-Manager/HTPC-Manager@26a641b

Replace imghdr with filetype (#66)

imghdr has been removed from Python standard library with v3.13. filetype is a slim replacement. As a little bonus, it can return the valid MIME type for network response, while imghdr returns the the type as extension only.

A builtin replacement would be mimetypes, but it returns the MIME type from file extension, hence does not work with the extension is not present or correct. filetype obtains the type from actual file content, like imghdr used to do.

We could make it conditional, keep using imghdr if present, but that would IMO bload the code unnecessarily, and as said, the method actually returned an invalid MIME type to the network client, as long as cherrypy did not internally convert extension to MIME type.

Signed-off-by: MichaIng micha@dietpi.com