Patch by Martin Vignali, test by Claudiu Popa.
+------------+-----------------------------------+
| ``'webp'`` | WebP files |
+------------+-----------------------------------+
+| ``'exr'`` | OpenEXR Files |
++------------+-----------------------------------+
+
+.. versionadded:: 3.5
+ The *exr* format was added.
.. versionchanged:: 3.5
The *webp* type was added.
*module* contains no docstrings instead of raising :exc:`ValueError`
(contributed by Glenn Jones in :issue:`15916`).
+imghdr
+------
+
+* :func:`~imghdr.what` now recognizes the `OpenEXR <http://www.openexr.com>`_
+ format (contributed by Martin vignali and Cladui Popa in :issue:`20295`).
+
importlib
---------
tests.append(test_webp)
+def test_exr(h, f):
+ if h.startswith(b'\x76\x2f\x31\x01'):
+ return 'exr'
+
+tests.append(test_exr)
+
#--------------------#
# Small test program #
#--------------------#
('python.tiff', 'tiff'),
('python.xbm', 'xbm'),
('python.webp', 'webp'),
+ ('python.exr', 'exr'),
)
class UnseekableIO(io.FileIO):
Library
-------
+- Issue #20295: imghdr now recognizes OpenEXR format images.
+
- Issue #21729: Used the "with" statement in the dbm.dumb module to ensure
files closing. Patch by Claudiu Popa.