subprocess.Popen only takes utf-8 encoded strings

This commit is contained in:
j 2011-04-05 18:03:26 +02:00
parent 234d80588c
commit 8a00a40d98

View file

@ -755,8 +755,8 @@ class Item(models.Model):
for poster in posters:
frame = posters[poster]
cmd = [settings.ITEM_POSTER,
'-t', self.get('title'),
'-d', ', '.join(self.get('director', ['Unknown Director'])),
'-t', self.get('title').encode('utf-8'),
'-d', u', '.join(self.get('director', ['Unknown Director'])).encode('utf-8'),
'-y', str(self.get('year', '')),
'-p', poster
]
@ -771,7 +771,6 @@ class Item(models.Model):
cmd += ['-o', self.oxdbId]
else:
cmd += ['-i', self.itemId]
print cmd
p = subprocess.Popen(cmd)
p.wait()
return posters.keys()