saimn / sigal

yet another simple static gallery generator
http://sigal.saimon.org/
MIT License
891 stars 169 forks source link

Unable to run on Solaris 11.3 with python 3.7 #237

Open mcmara opened 7 years ago

mcmara commented 7 years ago

Here it is a very simple structure:

$ ls -alR .
.:
total 116
drwxr-xr-x   3 mcmara   staff          4 Jan 31 21:32 .
drwxr-xr-x   9 mcmara   staff         18 Jan 31 21:04 ..
drwxr-xr-x   2 mcmara   staff          4 Jan 31 21:26 pictures
-rw-r--r--   1 mcmara   staff        127 Jan 31 21:31 sigal.conf.py

./pictures:
total 13015
drwxr-xr-x   2 mcmara   staff          4 Jan 31 21:26 .
drwxr-xr-x   3 mcmara   staff          4 Jan 31 21:32 ..
-rwxr-xr-x   1 mcmara   staff    4741682 Jan 31 21:05 pic1.jpg
-rwxr-xr-x   1 mcmara   staff    1839056 Jan 31 21:05 pic2.jpg

A default config file:

$ cat sigal.conf.py 
source = 'pictures'
theme = 'galleria'
img_size = (800, 600)
thumb_size = (280, 210)
ignore_directories = []
ignore_files = []

It fails with an obscure error:

$ /opt/local/python3/bin/sigal build
Sorting albums  [####################################]  100%
Sorting media  [####################################]  100%
Traceback (most recent call last):
  File "/opt/local/python3/bin/sigal", line 11, in <module>
    sys.exit(main())
  File "/opt/local/python3/lib/python3.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/opt/local/python3/lib/python3.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/opt/local/python3/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/local/python3/lib/python3.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/local/python3/lib/python3.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/local/python3/lib/python3.7/site-packages/sigal/__init__.py", line 141, in build
    gal = Gallery(settings, ncpu=ncpu)
  File "/opt/local/python3/lib/python3.7/site-packages/sigal/gallery.py", line 563, in __init__
    album.sort_medias(settings['medias_sort_attr'])
  File "/opt/local/python3/lib/python3.7/site-packages/sigal/gallery.py", line 344, in sort_medias
    reverse=self.settings['medias_sort_reverse'])
  File "/opt/local/python3/lib/python3.7/site-packages/sigal/gallery.py", line 341, in <lambda>
    key = lambda s: strxfrm(getattr(s, medias_sort_attr))
ValueError: character U+1010769 is not in range [U+0000; U+10ffff]

Any idea on what could be wrong? Here it is the system:

$ uname -a 
SunOS thalos 5.11 11.3 i86pc i386 i86pc
$ /opt/local/python3/bin/python3 --version
Python 3.7.0a0
saimn commented 7 years ago

@mcmara - It looks similar to http://bugs.python.org/issue16258 ? If you don't find a workaround, I guess we could add a failover on sigal to use a simple sort if the sort with the locale failed.