From 6ec7a2ca4d9198fd6b45033fae58739c6ca0a64b Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sun, 20 Mar 2016 15:40:42 -0400 Subject: [PATCH] Support unicode filenames in staging folders. --- HISTORY.rst | 1 + mayan/apps/sources/classes.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index c1dc0a5188..61bfa3745c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -25,6 +25,7 @@ - Remove the document index setup permission. - Status messages now display the object class on which they operate not just the word "Object". - More tests added. +- Handle unicode filenames in staging folders. 2.0.2 (2016-02-09) ================== diff --git a/mayan/apps/sources/classes.py b/mayan/apps/sources/classes.py index 847f573614..3ff49704af 100644 --- a/mayan/apps/sources/classes.py +++ b/mayan/apps/sources/classes.py @@ -50,10 +50,10 @@ class StagingFile(object): self.encoded_filename = str(encoded_filename) self.filename = base64.urlsafe_b64decode( urllib.unquote_plus(self.encoded_filename) - ) + ).decode('utf8') else: self.filename = filename - self.encoded_filename = base64.urlsafe_b64encode(filename) + self.encoded_filename = base64.urlsafe_b64encode(filename.encode('utf8')) def __unicode__(self): return unicode(self.filename)