Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/api/next_api_changes/deprecations/ 29529-TH.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Capitalization of None in matplotlibrc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In :file:`matplotlibrc` config files every capitalization of None was
accepted for denoting the Python constant `None`. This is deprecated. The
only accepted capitalization is now None, i.e. starting with a capital letter
and all other letters in lowercase.
8 changes: 8 additions & 0 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@
def validator(s):
if (allow_none and
(s is None or cbook._str_lower_equal(s, "none"))):
if cbook._str_lower_equal(s, "none") and s != "None":
_api.warn_deprecated(

Check warning on line 195 in lib/matplotlib/rcsetup.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/rcsetup.py#L195

Added line #L195 was not covered by tests
"3.11",
message=f"Using the capitalization {s!r} in matplotlibrc for "
"*None* is deprecated in %(removal)s and will lead to an "
"error from version 3.13 onward. Please use 'None' "
"instead."
)
return None
if cls is str and not isinstance(s, str):
raise ValueError(f'Could not convert {s!r} to str')
Expand Down
Loading