Restored Makernote as a deprecated enum by radarhere · Pull Request #8629 · python-pillow/Pillow

hugovk

Exif = 0x8769
GPSInfo = 0x8825
MakerNote = 0x927C
Makernote = 0x927C # Deprecated

Choose a reason for hiding this comment

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

Can we raise a deprecation warning when accessed?

We've had problems before, removing VERSION after only deprecating in docs.

Choose a reason for hiding this comment

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

I've tried __getattr__, __getitem__ and @property, and I don't think so, no.

It was only added in #6748 in Pillow 9.4.0, so I would expect this to have smaller use.

Choose a reason for hiding this comment

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

Thanks for checking.

Yeah, I expect this should cause much less breakage.

Still, if we can't warn in code, perhaps we should just deprecate this without planning to remove it? It doesn't cost anything to keep this one line.

Choose a reason for hiding this comment

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

Do you mean just restore the enum value, and add a comment? Done.

Choose a reason for hiding this comment

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

Yes, and we can also document it as deprecated, but don't mention any removal date:

-``ExifTags.IFD.Makernote`` has been deprecated and will be removed in Pillow 13
-(2026-10-15). Instead, use ``ExifTags.IFD.MakerNote``.
+``ExifTags.IFD.Makernote`` has been deprecated. Instead, use ``ExifTags.IFD.MakerNote``.