store media folder as unicode so we can log updated files in unicode

This commit is contained in:
Damien Elmes 2012-03-13 22:12:21 +09:00
parent 0843db03fd
commit 1f95045621

View file

@ -21,6 +21,9 @@ class MediaManager(object):
self.col = col
# media directory
self._dir = re.sub("(?i)\.(anki2)$", ".media", self.col.path)
# convert dir to unicode if it's not already
if isinstance(self._dir, str):
self._dir = unicode(self._dir, sys.getfilesystemencoding())
if not os.path.exists(self._dir):
os.makedirs(self._dir)
try: