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]: macOS font discovery raises KeyError('_items') for an incomplete system_profiler font record #32328
On macOS arm64, importing matplotlib.pyplot through DNA Chisel during a command-line smoke test failed in _get_macos_fonts with KeyError: '_items'. Matplotlib is 3.10.8, Python 3.12.6. The process was running with restricted filesystem access; Matplotlib could not write its default cache directory and created a temporary cache before scanning fonts.
The payload is a minimal synthetic reproduction of the missing-key condition, not a capture of the entire system_profiler response. The actual CLI traceback ended at:
font_manager.py, in _get_macos_fonts
return [Path(entry["path"]) for entry in d["_items"]]
KeyError: '_items'
Expected behavior
Treat unavailable/incomplete system font discovery as an empty or partial result, consistent with the existing OSError/subprocess-error fallbacks, rather than making pyplot import fail. A regression could cover missing _items and entries without a path.
This is a robustness report; no change to font selection semantics is requested when system_profiler returns a complete record. Downstream discovery: openvax/vaxrank#428.
This specific error isn't going to occur after #31977, as we no longer use system_profiler or parse a plist. Can you provide more information about "The process was running with restricted filesystem access"? I want to ensure that our new approach using CoreText handles this case.
This remains reproducible with Matplotlib 3.11.2 on macOS / Python 3.12.6 in the Tsarina canine-report validation. A cold-cache full run had 708 passing tests and four failures ending in _get_macos_fonts -> d['_items'] -> KeyError('_items'), including one existing human plotting test. The standalone report CLI failed at the same parser boundary. No raw system-profiler/font inventory is attached.
A matching local font cache (format 3.11.0) in an explicit writable MPLCONFIGDIR loads and renders SVG successfully; this is the temporary test-environment recovery, not a patch to Matplotlib. The source still directly indexes d['_items'] after its subprocess/plist-error handlers. Missing-key discovery should degrade to unavailable/partial system fonts rather than prevent pyplot import, as requested in the original issue.
Can you please elaborate on "The process was running with restricted filesystem access" from the original description. I want to make sure that our new path in 3.12 fixes this. Thank you!
Activity
iccir commentedon Sep 9, 2026
Likely fixed by #31977
iccir commentedon Sep 10, 2026
This specific error isn't going to occur after #31977, as we no longer use
system_profileror parse a plist. Can you provide more information about "The process was running with restricted filesystem access"? I want to ensure that our new approach using CoreText handles this case.iskandr commentedon Oct 9, 2026
This remains reproducible with Matplotlib 3.11.2 on macOS / Python 3.12.6 in the Tsarina canine-report validation. A cold-cache full run had 708 passing tests and four failures ending in
_get_macos_fonts -> d['_items'] -> KeyError('_items'), including one existing human plotting test. The standalone report CLI failed at the same parser boundary. No raw system-profiler/font inventory is attached.A matching local font cache (format 3.11.0) in an explicit writable
MPLCONFIGDIRloads and renders SVG successfully; this is the temporary test-environment recovery, not a patch to Matplotlib. The source still directly indexesd['_items']after its subprocess/plist-error handlers. Missing-key discovery should degrade to unavailable/partial system fonts rather than prevent pyplot import, as requested in the original issue.iccir commentedon Oct 9, 2026
This will not be fixed until 3.12.
Can you please elaborate on "The process was running with restricted filesystem access" from the original description. I want to make sure that our new path in 3.12 fixes this. Thank you!
pin matplotlib at 3.10 until matplotlib/matplotlib#32328 is resolved