You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: _copy_css_file assumes that the _static directory already exists #20747
The function _copy_css_file in sphinxext/plot_directive.py assumes that the _static directory already exists. If it doesn't, then rather than creating _static/plot_directive.css with the appropriate content, it instead writes that content to a file _static. If another part of Sphinx then tries to create a directory _static, it results in an error.
We run into this problem in Sagemath (see https://trac.sagemath.org/ticket/32262) because we have a complicated directory layout for Sphinx output, and the _static directory may not be created right away.
Sphinx raises an error: OSError: WARNING: cannot copy static file FileExistsError(17, 'File exists'). A more complete traceback is at https://trac.sagemath.org/ticket/31580.
Expected outcome
Used to work with version 3.3.4 of matplotlib, which I believe is before the function _copy_css_file was introduced.
Activity
BUGFIX: make plot directive naively "responsive"
Ensure _static directory exists before copying CSS.