Skip to content

Conversation

@lukegb
Copy link
Contributor

@lukegb lukegb commented Jun 3, 2025

The _set method is no longer necessary, since we no longer compute any attributes from the profile. In most cases, we only set the profile, and in only one branch do we set the filename to anything non-None.

product_name/product_info were set to None at some point during what appears to be a batch of changes for Python 3 compatibility (ce041fd), and never set back. Given this, let's deprecate these and schedule them for removal in Pillow 13.

Changes proposed in this pull request:

  • Add attribute typing to ImageCmsProfile
  • Deprecate ImageCms.ImageCmsProfile.product_name, ImageCms.ImageCmsProfile.product_info
  • Deprecate ImageCms.ImageCmsProfile._set
@radarhere radarhere added the Deprecation Feature that will be removed in the future label Jun 3, 2025
@radarhere radarhere mentioned this pull request Jun 3, 2025
lukegb and others added 3 commits June 3, 2025 20:20
…/product_info The _set method is no longer necessary, since we no longer compute any attributes from the profile. In most cases, we only set the profile, and in only one branch do we set the filename to anything non-None. product_name/product_info were set to None at some point during what appears to be a batch of changes for Python 3 compatibility (ce041fd), and never set back. Given this, let's deprecate these and schedule them for removal in Pillow 13.
@lukegb lukegb force-pushed the imagecms-typing branch from 3110b32 to 54421b5 Compare June 3, 2025 19:21
``ImageCms.ImageCmsProfile.product_name`` and the corresponding
``.product_info`` attributes have been deprecated, and will be removed in
Pillow 13 (2026-10-15). These attributes can be accessed on the ``.profile``
attribute of ``ImageCmsProfile`` instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following this.

>>> from PIL import ImageCms >>> profile = ImageCms.ImageCmsProfile(ImageCms.createProfile("sRGB")) >>> profile.profile.product_name Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'PIL.ImageCms.core.CmsProfile' object has no attribute 'product_name'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed commits to remove the replacement suggestion.

@hugovk
Copy link
Member

hugovk commented Jun 8, 2025

  • Deprecate ImageCms.ImageCmsProfile._set

This is an undocumented underscore method, so not part of the public API and can be changed/removed without deprecation.

https://pillow.readthedocs.io/en/stable/reference/ImageCms.html

@radarhere
Copy link
Member

I've created #9032, to move forward with part of this at least.

@radarhere radarhere changed the title Add typing information to ImageCmsProfile, and deprecate product_name/product_info Deprecate ImageCmsProfile product_name and product_info Jul 26, 2025
@radarhere radarhere merged commit ec6d5ef into python-pillow:main Jul 26, 2025
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Deprecation Feature that will be removed in the future

3 participants