Properly handle text attachment encodings for thumbnail generation.

Review Request #5630 — Created March 16, 2014 and submitted

Information

Review Board
release-1.7.x
592db83...

Reviewers

Uploading a utf-16le encoded text file as an attachment would cause a
traceback, since it can't be coerced to unicode using the default encoding.
Since we have the mimetype, we can pull the encoding out of that, and decode
properly.

Ran unit tests and tested uploading file through the web UI.

chipx86
  1. 
      
  2. reviewboard/attachments/mimetypes.py (Diff revision 1)
     
     

    Are we guaranteed to have 3 parts to the mimetype?

    1. Yes, the third part of the tuple will always be a dict.

  3. 
      
chipx86
  1. Ship It!

  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-1.7.x (64b78f6).
Loading...