unicode path issues, fixes #2069

This commit is contained in:
j 2014-01-18 11:22:58 +00:00
parent 13df4cd116
commit effeb65115

View file

@ -410,6 +410,8 @@ class Item(models.Model):
def delete_files(self):
path = os.path.join(settings.MEDIA_ROOT, self.path())
if isinstance(path, unicode):
path = path.encode('utf-8')
if os.path.exists(path):
shutil.rmtree(path)