Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,29 @@ Deprecated features
Below are features which are considered deprecated. Where appropriate,
a ``DeprecationWarning`` is issued.

Image.__del__
~~~~~~~~~~~~~

.. deprecated:: 6.1.0

Implicitly closing the image's underlying file in ``Image.__del__`` has been deprecated.
Use a context manager or call ``Image.close()`` instead to close the file in a
deterministic way.

Deprecated:

.. code-block:: python

im = Image.open("hopper.png")
im.save("out.jpg")

Use instead:

.. code-block:: python

with Image.open("hopper.png") as im:
im.save("out.jpg")

Python 2.7
~~~~~~~~~~

Expand Down
26 changes: 26 additions & 0 deletions docs/releasenotes/6.1.0.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
6.1.0
-----

Deprecations
============

Image.__del__
^^^^^^^^^^^^^

.. deprecated:: 6.1.0

Implicitly closing the image's underlying file in ``Image.__del__`` has been deprecated.
Use a context manager or call ``Image.close()`` instead to close the file in a
deterministic way.

Deprecated:

.. code-block:: python

im = Image.open("hopper.png")
im.save("out.jpg")

Use instead:

.. code-block:: python

with Image.open("hopper.png") as im:
im.save("out.jpg")

API Additions
=============

Expand Down