Ticket #935: 0001-Raw-image-mediatype-has-a-logging-call-not-encoding-.patch

File 0001-Raw-image-mediatype-has-a-logging-call-not-encoding-.patch, 1.3 KB (added by Odin Hørthe Omdal (Velmont), 10 years ago)
  • mediagoblin/media_types/raw_image/processing.py

    From 389b2d2e6c1224bc91ae70a52470a26d785fdd87 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Odin=20H=C3=B8rthe=20Omdal?= <odinho@opera.com>
    Date: Sun, 3 Aug 2014 18:07:28 +0200
    Subject: [PATCH] Raw image mediatype has a logging call not encoding to utf8
    
    Was causing UnicodeDecodeError when file/folder was not ascii.
    Fixes bug #935.
    ---
     mediagoblin/media_types/raw_image/processing.py | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/mediagoblin/media_types/raw_image/processing.py b/mediagoblin/media_types/raw_image/processing.py
    index 83b0155..c3fe827 100644
    a b class InitialRawProcessor(InitialProcessor):  
    6767        # Extract the biggest preview and write it as our working image
    6868        md.previews[-1].write_to_file(
    6969            self.process_filename.encode('utf-8'))
    70         self.process_filename += ".jpg"
     70        self.process_filename += '.jpg'
    7171        _log.debug('Wrote new file from {0} to preview (jpg) {1}'.format(
    72             self._original_raw, self.process_filename))
     72            self._original_raw.encode('utf-8'),
     73            self.process_filename.encode('utf-8')))
    7374
    7475        # Override the namebuilder with our new jpg-based name
    7576        self.name_builder = FilenameBuilder(self.process_filename)