Mimetypes-magic

Latest version: v0.4.30

Safety actively analyzes 681866 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.4.25

- Support os.PathLike values in Magic.from_file and magic.from_file

0.4.24

- Fix regression in library loading on some Alpine docker images.

0.4.23

- Include a `py.typed` sentinal to enable type checking
- Improve fix for attribute error during destruction
- Cleanup library loading logic
- Add new homebrew library dir for OSX

0.4.22

- Unify dll loader between the standard and compat library, fixing load
failures on some previously supported platforms.

0.4.20

- merge in a compatibility layer for the upstream libmagic python binding.
Since both this package and that one are called 'magic', this compat layer
removes a very common source of runtime errors. Use of that libmagic API will
produce a deprecation warning.

- support python 3.9 in tests and pypi metadata

- add support for magic_descriptor functions, which take a file descriptor
rather than a filename.

- sometimes the returned description includes snippets of the file, e.g a title
for MS Word docs. Since this is in an unknown encoding, we would throw a
unicode decode error trying to decode. Now, it decodes with
'backslashreplace' to handle this more gracefully. The undecodable characters
are replaced with hex escapes.

- add support for MAGIC_EXTENSION, to return possible file extensions.

- add mypy typing stubs file, for type checking

0.4.18

- Make bindings for magic_[set|get]param optional, and throw NotImplementedError
if they are used but not supported. Only call setparam() in the constructor if
it's supported. This prevents breakage on CentOS7 which uses an old version of
libmagic.

- Add tests for CentOS 7 & 8

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.