dont fail to create torrent for unicode titles

This commit is contained in:
j 2013-10-08 06:56:45 +00:00
parent 6386ec9b14
commit 9db8b57dd2

View file

@ -1059,6 +1059,8 @@ class Item(models.Model):
return
base = self.path('torrent')
base = os.path.abspath(os.path.join(settings.MEDIA_ROOT, base))
if isinstance(base, unicode):
base = base.encode('utf-8')
if os.path.exists(base):
shutil.rmtree(base)
ox.makedirs(base)