Open
Description
Bug summary
matplotlib.get_backend()
will get stuck if DISPLAY
cannot be connected. Maybe should consider adding a timeout here.
matplotlib/src/_c_internal_utils.c
Lines 19 to 37 in 1b4b50b
Code for reproduction
import matplotlib
matplotlib.get_backend()
Actual outcome
get stuck
Expected outcome
return headless
if DISPLAY
cannot be connected
Additional information
No response
Operating system
No response
Matplotlib Version
3.7.3
Matplotlib Backend
No response
Python version
3.11.3
Jupyter version
No response
Installation
pip