mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #693
This commit is contained in:
parent
cbf7c8bf8c
commit
c3fecac479
@ -250,7 +250,10 @@ class RecursiveFetcher(object, LoggingInterface):
|
|||||||
self.log_debug('Error: %s', str(err), exc_info=True)
|
self.log_debug('Error: %s', str(err), exc_info=True)
|
||||||
continue
|
continue
|
||||||
c += 1
|
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:
|
with self.imagemap_lock:
|
||||||
self.imagemap[iurl] = imgpath
|
self.imagemap[iurl] = imgpath
|
||||||
open(imgpath, 'wb').write(f.read())
|
open(imgpath, 'wb').write(f.read())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user