Skip to content

Unicode filenames break server #104

@kevinlondon

Description

@kevinlondon

If you use Unicode characters for filenames, it causes the server not to run. Locally, I added filename = filename.decode("utf-8") at the start of the __init__ method for Media in the gallery.py file and that resolved the issue.

Traceback (most recent call last):
  File "/usr/home/kevin/.virtualenvs/thumbtest/bin/sigal", line 11, in <module>
    sys.exit(main())
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/sigal/__init__.py", line 154, in main
    parser.dispatch()
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/argh/helpers.py", line 53, in dispatch
    return dispatch(self, *args, **kwargs)
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/argh/dispatching.py", line 125, in dispatch
    for line in lines:
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/argh/dispatching.py", line 202, in _execute_command
    for line in result:
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/argh/dispatching.py", line 185, in _call
    result = args.function(*positional, **keywords)
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/sigal/__init__.py", line 108, in build
    gal = Gallery(settings, theme=theme, ncpu=ncpu)
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/sigal/gallery.py", line 452, in __init__
    album = Album(relpath, settings, dirs, files, self)
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/sigal/gallery.py", line 205, in __init__
    media = Image(f, self.path, settings)
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/sigal/gallery.py", line 129, in __init__
    super(Image, self).__init__(filename, path, settings)
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/site-packages/sigal/gallery.py", line 74, in __init__
    self.dst_path = join(settings['destination'], path, filename)
  File "/usr/home/kevin/.virtualenvs/thumbtest/lib/python2.7/posixpath.py", line 80, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6: ordinal not in range(128)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions