Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 03fc2ef

Browse filesBrowse files
anntzertimhoffm
authored andcommitted
Deprecate rcsetup.validate_path_exists. (#14347)
* Deprecate rcsetup.validate_path_exists. It's only used to validate setting the path to the matplotlib data, but of course the path just existing hardly indicates that that's the correct path to the matplotlib data; moreover, the intent (see `_get_data_path`) is that it should not be user-settable to start with. * correct deprecation version
1 parent 29265dc commit 03fc2ef
Copy full SHA for 03fc2ef

File tree

Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
4+
``rcsetup.validate_path_exists`` is deprecated (use ``os.path.exists`` to check
5+
whether a path exists).

‎lib/matplotlib/rcsetup.py

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def validate_any(s):
109109
validate_anylist = _listify_validator(validate_any)
110110

111111

112+
@cbook.deprecated("3.2", alternative="os.path.exists")
112113
def validate_path_exists(s):
113114
"""If s is a path, return s, else False"""
114115
if s is None:
@@ -957,8 +958,7 @@ def _validate_linestyle(ls):
957958
'webagg.open_in_browser': [True, validate_bool],
958959
'webagg.port_retries': [50, validate_int],
959960
'toolbar': ['toolbar2', validate_toolbar],
960-
'datapath': [None, validate_path_exists], # handled by
961-
# _get_data_path_cached
961+
'datapath': [None, validate_any], # see _get_data_path_cached
962962
'interactive': [False, validate_bool],
963963
'timezone': ['UTC', validate_string],
964964

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.