New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pelican-gist fails on systems where /tmp is not available or read-only #15

Open
jerryasher opened this Issue Sep 13, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@jerryasher
def setup_gist(pelican):
    """Setup the default settings."""
    pelican.settings.setdefault('GIST_CACHE_ENABLED', True)
    pelican.settings.setdefault('GIST_CACHE_LOCATION',
                                '/tmp/gist-cache')
    # Make sure the gist cache directory exists
    cache_base = pelican.settings.get('GIST_CACHE_LOCATION')
    if not os.path.exists(cache_base):
        os.makedirs(cache_base)

This fails on Android with "[Errno 30] Read-only file system'.

I think if '/tmp/gist-cache' were replaced with similar calls using the tempfile module it would be more easily portable.

@streeter

This comment has been minimized.

Show comment
Hide comment
@streeter

streeter Sep 13, 2016

Owner

Ah, makes sense. Part of the reason that I'd picked /tmp/gist-cache is that it is still there between subsequent runs (without a reboot).

However, I could use the GIST_CACHE_LOCATION setting to provide that as well.

Owner

streeter commented Sep 13, 2016

Ah, makes sense. Part of the reason that I'd picked /tmp/gist-cache is that it is still there between subsequent runs (without a reboot).

However, I could use the GIST_CACHE_LOCATION setting to provide that as well.

@jerryasher

This comment has been minimized.

Show comment
Hide comment
@jerryasher

jerryasher Sep 13, 2016

Using GIST_CACHE_LOCATION will probably solve my problem, I thought you would like to know.

I actually got beyond this minor issue to find pelican dropping dead on Android with a PermissionError but no other information beyond that. Oh well.

Using GIST_CACHE_LOCATION will probably solve my problem, I thought you would like to know.

I actually got beyond this minor issue to find pelican dropping dead on Android with a PermissionError but no other information beyond that. Oh well.

@jerryasher

This comment has been minimized.

Show comment
Hide comment
@jerryasher

jerryasher Sep 14, 2016

FWIW, I believe all I had to do to get it work is to set

GIST_CACHE_LOCATION = "TMPDIR"
in pelicanconf.py

jerryasher commented Sep 14, 2016

FWIW, I believe all I had to do to get it work is to set

GIST_CACHE_LOCATION = "TMPDIR"
in pelicanconf.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment