Skip to content
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

IOerror if source files are not writable by sigal user #161

Closed
derpeter opened this issue May 26, 2015 · 4 comments
Closed

IOerror if source files are not writable by sigal user #161

derpeter opened this issue May 26, 2015 · 4 comments

Comments

@derpeter
Copy link

I updated sigal to 0.9.2 from 0.7. Since the update sigal crashes during build process by accessing (probably modifying?) the image files copied to the build dir if the original file is not writable by the user running sigal. (see log below). This has not happened with the old version. As these files are copied by sigal, sigal could alter the file rights during the copy process to make sure it will not fail later in the process.

The obvious quickfix is fixing the permission in the source directory.

Traceback (most recent call last):
File "/usr/local/bin/sigal", line 9, in
load_entry_point('sigal==0.9.2', 'console_scripts', 'sigal')()
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 664, in call
return self.main(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 644, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 837, in invoke
return ctx.invoke(self.callback, *_ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 464, in invoke
return callback(_args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/sigal/init.py", line 133, in build
gal.build(force=force)
File "/usr/local/lib/python2.7/dist-packages/sigal/gallery.py", line 616, in build
writer.write(album)
File "/usr/local/lib/python2.7/dist-packages/sigal/writer.py", line 110, in write
page = self.template.render(**self.generate_context(album))
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/sigal/themes/galleria/templates/index.html", line 82, in top-level template code
data-description="{{ img_description(media) }}"/>
File "/usr/local/lib/python2.7/dist-packages/sigal/themes/galleria/templates/index.html", line 62, in template
{%- if media.big %}Full size{% endif %}
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 397, in getattr
return getattr(obj, attribute)
File "/usr/local/lib/python2.7/dist-packages/sigal/gallery.py", line 105, in big
symlink=s['orig_link'])
File "/usr/local/lib/python2.7/dist-packages/sigal/utils.py", line 47, in copy
func(src, dst)
File "/usr/lib/python2.7/shutil.py", line 130, in copy2
copyfile(src, dst)
File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: u'/ #my image#.jpg'

@saimn
Copy link
Owner

saimn commented Jun 22, 2015

Hi @derpeter ,
Sorry for the lack of answer, did you find a solution for your issue ?

@derpeter
Copy link
Author

Hi @saimn
Yes, I just fixed the filepermissions. I just wanted to report this as a bug. Sigal shut not crash but report the permission problem.

@saimn
Copy link
Owner

saimn commented Jun 22, 2015

Ok, I agree with you, but from the traceback I don't understand what happened: is #my image#.jpg the real filename of your file ? (With the # it looks like a temp file generated by some software). The error happens during the copy, so it seems sigal has not the right to copy to your dest path, or I am missing something ?

@saimn
Copy link
Owner

saimn commented Sep 26, 2017

Closing old issues, please reopen if needed.

@saimn saimn closed this as completed Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants