From fae8aa1405279b630456880f0689f2eece115154 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 8 Jul 2013 11:32:40 +0530 Subject: [PATCH] Dont change into temp dir when downloading single covers Works around the problem with temp dir permissions on some windows computers. --- src/calibre/ebooks/metadata/sources/worker.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/worker.py b/src/calibre/ebooks/metadata/sources/worker.py index 51fb883e7d..1c83f965e1 100644 --- a/src/calibre/ebooks/metadata/sources/worker.py +++ b/src/calibre/ebooks/metadata/sources/worker.py @@ -106,7 +106,6 @@ def single_identify(title, authors, identifiers): r in results], dump_caches(), log.dump() def single_covers(title, authors, identifiers, caches, tdir): - os.chdir(tdir) load_caches(caches) log = GUILog() results = Queue() @@ -126,9 +125,9 @@ def single_covers(title, authors, identifiers, caches, tdir): name += '{%d}'%c[plugin.name] c[plugin.name] += 1 name = '%s,,%s,,%s,,%s.cover'%(name, width, height, fmt) - with open(name, 'wb') as f: + with open(os.path.join(tdir, name), 'wb') as f: f.write(data) - os.mkdir(name+'.done') + os.mkdir(os.path.join(tdir, name+'.done')) return log.dump()