Hi all,

Probably a configuration issue on my part, but I'm getting to my wits end. 
Site crashes in the thumbnail template tag on any gallery related portion:
UnicodeEncodeError at / 

'ascii' codec can't encode character u'\u0301' in position 83: ordinal not in 
range(128)



   - 
   
/home/foxwoods/.virtualenvs/skylerdawson.com/local/lib/python2.7/site-packages/mezzanine/core/templatetags/mezzanine_tags.pyin
 
   thumbnail 
   1. 
      
                                   settings.THUMBNAILS_DIR_NAME, image_name)
      
      ...
    ▼ Local vars <http://localhost:8000/#> 
     Variable Value   thumb_name 
   
   u'A\u0301vila, Spain_2-90x90.jpg'
   
    ImageFile 
   
   <module 'PIL.ImageFile' from 
'/home/foxwoods/.virtualenvs/skylerdawson.com/local/lib/python2.7/site-packages/PIL/ImageFile.pyc'>
   
    image_prefix 
   
   u'A\u0301vila, Spain_2'
   
    padding_color 
   
   u'#fff'
   
    image_dir 
   
   u'uploads/gallery'
   
    Image 
   
   <module 'PIL.Image' from 
'/home/foxwoods/.virtualenvs/skylerdawson.com/local/lib/python2.7/site-packages/PIL/Image.pyc'>
   
    filetype 
   
   u'JPEG'
   
    image_name 
   
   u'A\u0301vila, Spain_2.jpg'
   
    height 
   
   90
   
    padding 
   
   False
   
    width 
   
   90
   
    image_url 
   
   'uploads/gallery/A\u0301vila, Spain_2.jpg'
   
    ImageOps 
   
   <module 'PIL.ImageOps' from 
'/home/foxwoods/.virtualenvs/skylerdawson.com/local/lib/python2.7/site-packages/PIL/ImageOps.pyc'>
   
    quality 
   
   95
   
    top 
   
   0.5
   
    image_ext 
   
   u'.jpg'
   
    left 
   
   0.5
   
     - 
   /home/foxwoods/.virtualenvs/skylerdawson.com/lib/python2.7/posixpath.pyin 
   join 
   1. 
      
                  path += '/' + b
      
      ...
    ▶ Local vars <http://localhost:8000/#> 
   - 
   
/home/foxwoods/.virtualenvs/skylerdawson.com/local/lib/python2.7/site-packages/unipath/abstractpath.pyin
 
   __add__ 
   1. 
      
              return self.__class__(resultStr)
      
      ...
    ▶ Local vars <http://localhost:8000/#> 
   - 
   
/home/foxwoods/.virtualenvs/skylerdawson.com/local/lib/python2.7/site-packages/unipath/abstractpath.pyin
 
   __new__ 
   1. 
      
              return _base.__new__(class_, newpath)
      
      ...
    ▶ Local vars <http://localhost:8000/#> 
   

Unicode error hint 

The string that could not be encoded/decoded was: *ils/Ávila,*

On my root page I'm displaying the last 9 gallery images, which currently 
has the default image data provided as a fixture when creating my sample 
mezzanine db.
So I've read that this could be an issue when I created the database 
apparently, but my locale seems to be setup properly, and I've tried 
recreating the DB specifically setting the character encoding as UTF8 
(postgresql). Using SHOW ALL; on my database shows all the locales set to 
en_CA.UTF-8. And the output of locale:
foxwoods@FoxwoodsWebDev ~ $ locale
LANG=en_CA.UTF-8
LANGUAGE=en_CA.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=en_CA.UTF-8

So I'm not sure if this is an error in the template tag code or in my 
db/environment setup.

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to