From ce0e433703c7a791230b5b4f73640afcf85c6a7f Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 30 Jun 2021 20:35:32 -0400 Subject: [PATCH] Fix deprecation of encoding in plot_directive. --- lib/matplotlib/sphinxext/plot_directive.py | 2 +- lib/matplotlib/tests/tinypages/some_plots.rst | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 6a9d316dfbf4..3136e6ea5631 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -197,7 +197,7 @@ def _option_format(arg): def _deprecated_option_encoding(arg): - _api.warn_deprecated("3.5", "encoding", obj_type="option") + _api.warn_deprecated("3.5", name="encoding", obj_type="option") return directives.encoding(arg) diff --git a/lib/matplotlib/tests/tinypages/some_plots.rst b/lib/matplotlib/tests/tinypages/some_plots.rst index bab58fd3a8c2..fdf7db93bc7c 100644 --- a/lib/matplotlib/tests/tinypages/some_plots.rst +++ b/lib/matplotlib/tests/tinypages/some_plots.rst @@ -120,9 +120,11 @@ Plot 14 uses ``include-source``: # Only a comment -Plot 15 uses an external file with the plot commands and a caption: +Plot 15 uses an external file with the plot commands and a caption (the +encoding is ignored and just verifies the deprecation is not broken): .. plot:: range4.py + :encoding: utf-8 This is the caption for plot 15.