From c3fecac479a624ba1ea8d57b93a0c7c733b279f3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 18 May 2008 07:16:40 -0700 Subject: [PATCH] Fix #693 --- src/calibre/web/fetch/simple.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/web/fetch/simple.py b/src/calibre/web/fetch/simple.py index 6308eab3a0..1f489bd011 100644 --- a/src/calibre/web/fetch/simple.py +++ b/src/calibre/web/fetch/simple.py @@ -250,7 +250,10 @@ class RecursiveFetcher(object, LoggingInterface): self.log_debug('Error: %s', str(err), exc_info=True) continue c += 1 - imgpath = os.path.join(diskpath, sanitize_file_name('img'+str(c)+ext)) + fname = sanitize_file_name('img'+str(c)+ext) + if isinstance(fname, unicode): + fname = fname.encode('ascii', 'replace') + imgpath = os.path.join(diskpath, fname) with self.imagemap_lock: self.imagemap[iurl] = imgpath open(imgpath, 'wb').write(f.read())