Fix `matplotlib` `PermissionError`
@@ -687,9 +687,12 @@ def matplotlib_fname():
yield os.path.join(get_configdir(), 'matplotlibrc')
yield os.path.join(get_data_path(), 'matplotlibrc')
+ try:
for fname in gen_candidates():
if os.path.exists(fname) and not os.path.isdir(fname):
return fname
+ except PermissionError:
+ return os.path.join(os.path.expanduser("~"), "Documents/mpl-data/matplotlibrc")
raise RuntimeError("Could not find matplotlibrc file; your Matplotlib "
"install is broken")
