Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug summary
Pillow 11.3.0 hasdeprecated the 'mode' parameter forPIL.Image.fromarray(). The DeprecationWarning causes Azure DevOps builds using matplotlib's plt.figure() to fail whenPYTHONWARNINGS=error
Code for reproduction
This stacktrace is from an Azure DevOps Microsoft-hosted Windows agent ('windows-2019' VM image) using Python 3.9.13:
Traceback (mostrecentcalllast):<ourcodedeleted>self._fig=plt.figure(figsize=(9,6))File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\pyplot.py",line1027,infiguremanager=new_figure_manager(File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\pyplot.py",line550,innew_figure_managerreturn_get_backend_mod().new_figure_manager(*args,**kwargs)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backend_bases.py",line3507,innew_figure_managerreturncls.new_figure_manager_given_figure(num,fig)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backend_bases.py",line3512,innew_figure_manager_given_figurereturncls.FigureCanvas.new_manager(figure,num)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backend_bases.py",line1797,innew_managerreturncls.manager_class.create_with_canvas(cls,figure,num)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backends\_backend_tk.py",line504,increate_with_canvasmanager=cls(canvas,num,window)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backends\_backend_tk.py",line457,in__init__super().__init__(canvas,num)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backend_bases.py",line2665,in__init__tools.add_tools_to_container(self.toolbar)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backend_tools.py",line1007,inadd_tools_to_containercontainer.add_tool(tool,group,position)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backend_bases.py",line3323,inadd_toolself.add_toolitem(tool.name,group,position,File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backends\_backend_tk.py",line980,inadd_toolitembutton=NavigationToolbar2Tk._Button(frame,name,image_file,toggle,File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backends\_backend_tk.py",line825,in_ButtonNavigationToolbar2Tk._set_image_for_button(self,b)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backends\_backend_tk.py",line767,in_set_image_for_buttonim_alt=_recolor_icon(im,foreground)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\matplotlib\backends\_backend_tk.py",line754,in_recolor_iconreturnImage.fromarray(image_data,mode="RGBA")File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\PIL\Image.py",line3314,infromarraydeprecate("'mode' parameter",13)File"C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\PIL\_deprecate.py",line68,indeprecatewarnings.warn(DeprecationWarning:'mode'parameterisdeprecatedandwillberemovedinPillow13 (2026-10-15)
Similar failures occur in Linux and Windows on Pythons 3.9 and 3.12.
Actual outcome
DeprecationWarning: 'mode' parameter is deprecated and will be removed in Pillow 13 (2026-10-15)
Expected outcome
No deprecation warning.
Additional information
Our DevOps pipelines started breaking with this on 2 July when pillow (installed via pip) upgraded from 11.2.1 to 11.3.0.
Operating system
Windows
Matplotlib Version
3.9.4
Matplotlib Backend
Not sure, TkAgg?
Python version
3.9.13
Jupyter version
N/A
Installation
pip
Metadata
Metadata
Assignees
Labels
No labels