Description
Bug report
Bug summary
I have a large-ish tkinter/matplotlib application where I have defined a custom datapath in a matplotlibrc file in my current working directory. I recently updated matplotlib to v3.2.0 from v3.1.3, and my custom datapath is no longer being used. I noticed this was deprecated in 4833d99. However, I am not seeing the deprecation warning, as the "mpl-data" directory is also found and returned in the lines right above the deprecation warning. The problem surfaces when the custom data I had stored in my datapath is not found in the default path, and my application crashes.
If custom datapaths can no longer be used, could it be removed from the sample matplotlibrc file? (https://matplotlib.org/3.2.0/tutorials/introductory/customizing.html#a-sample-matplotlibrc-file)
Also, what is the recommended way of handling custom data, in my case, a handful of gifs? The commit mentions that
Note that redistributors (e.g. linux distro packagers) who may want to move mpl-data out can still do so by patching out the entire
_get_data_path
function.
but I'd rather not do that as it might break again soon with an update.
Code for reproduction
The following code will not reproduce the actual scenario where I encountered the error, but it shows that the custom datapath is not used and no deprecation warnings are displayed.
An empty datapath folder and a matplotlibrc file in the working directory, with the line
#datapath : /home/jdhunter/mpldata
uncommented and set to your datapath folder.
>>> import matplotlib.pyplot as plt
>>> plt.plot([1, 1, 1])
>>> plt.show()
Actual outcome
The plot is shown, so the custom datapath was not used, but no deprecation warnings are shown.
Expected outcome
The following was output on v3.1.3, where the custom datapath was used and it obviously did not contain the needed files resulting in an error:
_tkinter.TclError: couldn't open "ggg\images\matplotlib.ppm": no such file or directory
Matplotlib version
- Operating system: Microsoft Windows 10 Pro Version 1909
- Matplotlib version: 3.2.0 (pip installed)
- Matplotlib backend (
print(matplotlib.get_backend())
): TkAgg - Python version: 3.7.5