8000 Run in a system service / without configuration · Issue #20122 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Run in a system service / without configuration #20122
Closed
@piegamesde

Description

@piegamesde

Problem

I'm trying to run a python service that transitively depends on matplotlib. When starting, matplotlib crashes on the try to somehow get a configuration directory, because neither $HOME nor $XDG_CONFIG_HOME are set (of course, why would they be in a system service?). I tried working around by setting MPLCONFIGDIR, but to no effect – it still crashes on line 415. This too makes sense when looking at the code, because _get_config_or_cache_dir already takes in xdg_base as an input – even though it may not necessarily be used.

This is not the only problematic place. I see that the font loading handler also tries to access $HOME, and there are probably even more places

Proposed Solution

I don't know matplotlib, and what it needs config/cache for. Ideally, this would somehow be an optional feature. It seems that there already is some code to handle the case where the specified directories are not writable, which falls back to some temporary directories. It would be cool if this fallback was also used when $HOME or some other environment variables are not set.

Additional context and prior art

My service is a Flask application, running with gunicorn as a systemd service.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0