diff --git a/Tests/test_image.py b/Tests/test_image.py index 8acd5daa9..c185a1cb4 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -6,8 +6,7 @@ import tempfile import pytest -import PIL -from PIL import Image, ImageDraw, ImagePalette, ImageShow, UnidentifiedImageError +from PIL import Image, ImageDraw, ImagePalette, UnidentifiedImageError from .helper import ( assert_image_equal, @@ -832,18 +831,6 @@ class TestImage: except OSError as e: assert str(e) == "buffer overrun when reading image file" - def test_show_deprecation(self, monkeypatch): - monkeypatch.setattr(Image, "_show", lambda *args, **kwargs: None) - - im = Image.new("RGB", (50, 50), "white") - - with pytest.warns(None) as raised: - im.show() - assert not raised - - with pytest.warns(DeprecationWarning): - im.show(command="mock") - class MockEncoder: pass diff --git a/docs/deprecations.rst b/docs/deprecations.rst index 2a4813b1f..46596abda 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -25,14 +25,6 @@ vulnerability introduced in FreeType 2.6 (:cve:`CVE-2020-15999`). .. _2.10.4: https://sourceforge.net/projects/freetype/files/freetype2/2.10.4/ -Image.show command parameter -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. deprecated:: 7.2.0 - -The ``command`` parameter will be removed in Pillow 9.0.0 (2022-01-02). -Use a subclass of :py:class:`.ImageShow.Viewer` instead. - Tk/Tcl 8.4 ~~~~~~~~~~ @@ -80,6 +72,15 @@ Removed features Deprecated features are only removed in major releases after an appropriate period of deprecation has passed. +Image.show command parameter +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. deprecated:: 7.2.0 +.. versionremoved:: 9.0.0 + +The ``command`` parameter has been removed. Use a subclass of +:py:class:`.ImageShow.Viewer` instead. + Image._showxv ~~~~~~~~~~~~~ diff --git a/docs/releasenotes/9.0.0.rst b/docs/releasenotes/9.0.0.rst index 91f6c3b71..9991655e7 100644 --- a/docs/releasenotes/9.0.0.rst +++ b/docs/releasenotes/9.0.0.rst @@ -9,11 +9,11 @@ PILLOW_VERSION constant ``PILLOW_VERSION`` has been removed. Use ``__version__`` instead. -ImageFile.raise_ioerror -~~~~~~~~~~~~~~~~~~~~~~~ +Image.show command parameter +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -``IOError`` was merged into ``OSError`` in Python 3.3. So, ``ImageFile.raise_ioerror`` -has been removed. Use ``ImageFile.raise_oserror`` instead. +The ``command`` parameter has been removed. Use a subclass of +:py:class:`PIL.ImageShow.Viewer` instead. Image._showxv ~~~~~~~~~~~~~ @@ -21,3 +21,41 @@ Image._showxv ``Image._showxv`` has been removed. Use :py:meth:`~PIL.Image.Image.show` instead. If custom behaviour is required, use :py:meth:`~PIL.ImageShow.register` to add a custom :py:class:`~PIL.ImageShow.Viewer` class. + +ImageFile.raise_ioerror +~~~~~~~~~~~~~~~~~~~~~~~ + +``IOError`` was merged into ``OSError`` in Python 3.3. So, ``ImageFile.raise_ioerror`` +has been removed. Use ``ImageFile.raise_oserror`` instead. + +API Changes +=========== + +TODO +^^^^ + +TODO + +API Additions +============= + +TODO +^^^^ + +TODO + +Security +======== + +TODO +^^^^ + +TODO + +Other Changes +============= + +TODO +^^^^ + +TODO diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 6314160cb..da0bda7ec 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -2247,7 +2247,7 @@ class Image: if frame != 0: raise EOFError - def show(self, title=None, command=None): + def show(self, title=None): """ Displays this image. This method is mainly intended for debugging purposes. @@ -2267,14 +2267,7 @@ class Image: :param title: Optional title to use for the image window, where possible. """ - if command is not None: - warnings.warn( - "The command parameter is deprecated and will be removed in Pillow 9 " - "(2022-01-02). Use a subclass of ImageShow.Viewer instead.", - DeprecationWarning, - ) - - _show(self, title=title, command=command) + _show(self, title=title) def split(self): """ diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index 5ab53fa39..25b481243 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -30,7 +30,6 @@ import io import struct import sys -import warnings from . import Image from ._util import isPath diff --git a/src/PIL/__init__.py b/src/PIL/__init__.py index dbde52a1b..45fef241e 100644 --- a/src/PIL/__init__.py +++ b/src/PIL/__init__.py @@ -13,9 +13,6 @@ Use PIL.__version__ for this Pillow version. ;-) """ -import sys -import warnings - from . import _version # VERSION was removed in Pillow 6.0.0.