Mercurial > public > sg101
diff core/image_uploader.py @ 737:775e7f74096a
For #60, encode user photo filenames before logging.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 13 Dec 2013 19:59:36 -0600 |
parents | e888d627928f |
children | df2799f725d8 |
line wrap: on
line diff
--- a/core/image_uploader.py Sat Nov 09 11:53:23 2013 -0600 +++ b/core/image_uploader.py Fri Dec 13 19:59:36 2013 -0600 @@ -44,7 +44,8 @@ a thumbnail was not requested. """ - logger.info('Processing image file: {}'.format(fp.name)) + filename = fp.name.encode('utf-8') + logger.info('Processing image file: %s', filename) # Trying to use PIL (or Pillow) on a Django UploadedFile is often # problematic because the file is often an in-memory file if it is under @@ -92,6 +93,6 @@ thumb.getvalue(), metadata) - logger.info('Completed processing image file: {}'.format(fp.name)) + logger.info('Completed processing image file: %s', filename) return (image_url, thumb_url)